* file.c (file_expand_path): should not just copy the encoding
from fname. [ruby-core:28635] * file.c (EXPAND_PATH_BUFFER): set filesystem_encoding, not usascii for path buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0e9620fd38
commit
dc6075844d
@ -1,3 +1,11 @@
|
|||||||
|
Sat Mar 13 23:48:27 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (file_expand_path): should not just copy the encoding
|
||||||
|
from fname. [ruby-core:28635]
|
||||||
|
|
||||||
|
* file.c (EXPAND_PATH_BUFFER): set filesystem_encoding, not
|
||||||
|
usascii for path buffer.
|
||||||
|
|
||||||
Sat Mar 13 17:48:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Mar 13 17:48:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* tool/file2lastrev.rb: refactord. fixed changed revision of git.
|
* tool/file2lastrev.rb: refactord. fixed changed revision of git.
|
||||||
|
4
file.c
4
file.c
@ -2831,7 +2831,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||||||
p = buf + (s - b);
|
p = buf + (s - b);
|
||||||
BUFCHECK(bdiff >= buflen);
|
BUFCHECK(bdiff >= buflen);
|
||||||
memset(buf, '/', p - buf);
|
memset(buf, '/', p - buf);
|
||||||
rb_enc_copy(result, fname);
|
rb_enc_associate(result, rb_enc_check(result, fname));
|
||||||
}
|
}
|
||||||
if (p > buf && p[-1] == '/')
|
if (p > buf && p[-1] == '/')
|
||||||
--p;
|
--p;
|
||||||
@ -2998,7 +2998,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EXPAND_PATH_BUFFER() rb_usascii_str_new(0, MAXPATHLEN + 2)
|
#define EXPAND_PATH_BUFFER() rb_filesystem_str_new(0, MAXPATHLEN + 2)
|
||||||
|
|
||||||
#define check_expand_path_args(fname, dname) \
|
#define check_expand_path_args(fname, dname) \
|
||||||
((fname = rb_get_path(fname)), \
|
((fname = rb_get_path(fname)), \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user