mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
66141d47d7
commit
9af8102225
2 changed files with 8 additions and 0 deletions
|
@ -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>
|
Tue Oct 16 12:52:14 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||||
|
|
||||||
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_file):
|
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_file):
|
||||||
|
|
3
file.c
3
file.c
|
@ -3917,6 +3917,7 @@ rb_file_join(VALUE ary, VALUE sep)
|
||||||
long len, i;
|
long len, i;
|
||||||
VALUE result, tmp;
|
VALUE result, tmp;
|
||||||
const char *name, *tail;
|
const char *name, *tail;
|
||||||
|
int checked = TRUE;
|
||||||
|
|
||||||
if (RARRAY_LEN(ary) == 0) return rb_str_new(0, 0);
|
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];
|
tmp = RARRAY_PTR(ary)[i];
|
||||||
switch (TYPE(tmp)) {
|
switch (TYPE(tmp)) {
|
||||||
case T_STRING:
|
case T_STRING:
|
||||||
|
if (!checked) check_path_encoding(tmp);
|
||||||
StringValueCStr(tmp);
|
StringValueCStr(tmp);
|
||||||
break;
|
break;
|
||||||
case T_ARRAY:
|
case T_ARRAY:
|
||||||
|
@ -3958,6 +3960,7 @@ rb_file_join(VALUE ary, VALUE sep)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
FilePathStringValue(tmp);
|
FilePathStringValue(tmp);
|
||||||
|
checked = FALSE;
|
||||||
}
|
}
|
||||||
RSTRING_GETMEM(result, name, len);
|
RSTRING_GETMEM(result, name, len);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue