summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-29 06:22:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-29 06:22:29 +0000
commit51b0a2dcfe1f9c3ea5bd2fe11025dfca20966994 (patch)
treeeac7096f5038776479da6f8e53a66b42c3d11131 /file.c
parentc5682939099b2cfdd1efc9b59f78f35dc5cf8a28 (diff)
downloadruby-51b0a2dcfe1f9c3ea5bd2fe11025dfca20966994.tar.gz
ruby-51b0a2dcfe1f9c3ea5bd2fe11025dfca20966994.tar.xz
ruby-51b0a2dcfe1f9c3ea5bd2fe11025dfca20966994.zip
* file.c (rb_file_join): recursive array has no meaning as path
name. [ruby-core:23329] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/file.c b/file.c
index 40bf0267a..4b67b0217 100644
--- a/file.c
+++ b/file.c
@@ -3298,7 +3298,7 @@ static VALUE
file_inspect_join(VALUE ary, VALUE argp, int recur)
{
VALUE *arg = (VALUE *)argp;
- if (recur) return rb_usascii_str_new2("[...]");
+ if (recur || ary == arg[0]) rb_raise(rb_eArgError, "recursive array");
return rb_file_join(arg[0], arg[1]);
}
@@ -3332,7 +3332,10 @@ rb_file_join(VALUE ary, VALUE sep)
case T_STRING:
break;
case T_ARRAY:
- {
+ if (ary == tmp) {
+ rb_raise(rb_eArgError, "recursive array");
+ }
+ else {
VALUE args[2];
args[0] = tmp;