Skip to content

Commit

Permalink
file.c: ASCII-compatible
Browse files Browse the repository at this point in the history
* file.c (rb_file_join): need to check again after any conversion run.
  [ruby-core:48012] [Bug ruby#7168]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Oct 16, 2012
1 parent 66141d4 commit 9af8102
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tue Oct 16 14:56:23 2012 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* test/ruby/envutil.rb (Test::Unit::Assertions#assert_file):
Expand Down
3 changes: 3 additions & 0 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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:
Expand All @@ -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) {
Expand Down

0 comments on commit 9af8102

Please sign in to comment.