summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-16 05:56:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-16 05:56:25 +0000
commit9af8102225d13f3f5fd49e6e12f4819e5e1a437d (patch)
treee41757da489e69f97653d81416729d03e48ec356
parent66141d47d79f986951068d538b3972d14e7476d4 (diff)
file.c: ASCII-compatible
* file.c (rb_file_join): need to check again after any conversion run. [ruby-core:48012] [Bug #7168] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--file.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ed9c2a8902..6a4d60f168 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 16 14:56:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_join): need to check again after any conversion run.
+ [ruby-core:48012] [Bug #7168]
+
Tue Oct 16 12:52:14 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_file):
diff --git a/file.c b/file.c
index 3d1ffe4036..5951d7b5b5 100644
--- a/file.c
+++ b/file.c
@@ -3917,6 +3917,7 @@ rb_file_join(VALUE ary, VALUE sep)
long len, i;
VALUE result, tmp;
const char *name, *tail;
+ int checked = TRUE;
if (RARRAY_LEN(ary) == 0) return rb_str_new(0, 0);
@@ -3942,6 +3943,7 @@ rb_file_join(VALUE ary, VALUE sep)
tmp = RARRAY_PTR(ary)[i];
switch (TYPE(tmp)) {
case T_STRING:
+ if (!checked) check_path_encoding(tmp);
StringValueCStr(tmp);
break;
case T_ARRAY:
@@ -3958,6 +3960,7 @@ rb_file_join(VALUE ary, VALUE sep)
break;
default:
FilePathStringValue(tmp);
+ checked = FALSE;
}
RSTRING_GETMEM(result, name, len);
if (i == 0) {