mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
* file.c (append_fspath): revert a part of r37562.
* file.c (rb_file_expand_path_internal): ditto. * file.c (rb_file_expand_path_internal): ignore the encoding of the given path name and use filesystem encoding, except when the result is 8bit range and the filesystem encoding is US-ASCII. [ruby-dev:39393] [Bug #2154] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
350d4bcd0b
commit
7c9a4b2f0a
3 changed files with 18 additions and 6 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Fri Nov 9 16:17:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* file.c (append_fspath): revert a part of r37562.
|
||||
|
||||
* file.c (rb_file_expand_path_internal): ditto.
|
||||
|
||||
* file.c (rb_file_expand_path_internal): ignore the encoding of the
|
||||
given path name and use filesystem encoding, except when the result
|
||||
is 8bit range and the filesystem encoding is US-ASCII.
|
||||
[ruby-dev:39393] [Bug #2154]
|
||||
|
||||
Fri Nov 9 16:15:50 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
|
||||
|
||||
* test/csv/test_features.rb: add require for Tempfile.
|
||||
|
|
7
file.c
7
file.c
|
@ -2875,7 +2875,7 @@ append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encodi
|
|||
size_t dirlen = strlen(dir), buflen = rb_str_capacity(result);
|
||||
|
||||
if (*enc != fsenc) {
|
||||
rb_encoding *direnc = rb_enc_check(dirname = rb_enc_str_new(dir, dirlen, fsenc), fname);
|
||||
rb_encoding *direnc = rb_enc_check(fname, dirname = rb_enc_str_new(dir, dirlen, fsenc));
|
||||
if (direnc != fsenc) {
|
||||
dirname = rb_str_conv_enc(dirname, fsenc, direnc);
|
||||
RSTRING_GETMEM(dirname, cwdp, dirlen);
|
||||
|
@ -2980,7 +2980,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
|
|||
else if (!rb_is_absolute_path(s)) {
|
||||
if (!NIL_P(dname)) {
|
||||
rb_file_expand_path_internal(dname, Qnil, abs_mode, long_name, result);
|
||||
rb_enc_check(result, fname);
|
||||
rb_enc_associate(result, rb_enc_check(result, fname));
|
||||
BUFINIT();
|
||||
p = pend;
|
||||
}
|
||||
|
@ -3009,7 +3009,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
|
|||
BUFCHECK(bdiff >= buflen);
|
||||
memset(buf, '/', len);
|
||||
rb_str_set_len(result, len);
|
||||
rb_enc_check(result, fname);
|
||||
rb_enc_associate(result, rb_enc_check(result, fname));
|
||||
}
|
||||
if (p > buf && p[-1] == '/')
|
||||
--p;
|
||||
|
@ -3228,6 +3228,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
|
|||
|
||||
if (tainted) OBJ_TAINT(result);
|
||||
rb_str_set_len(result, p - buf);
|
||||
rb_enc_check(fname, result);
|
||||
ENC_CODERANGE_CLEAR(result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#define RUBY_VERSION "1.9.3"
|
||||
#define RUBY_PATCHLEVEL 324
|
||||
#define RUBY_PATCHLEVEL 325
|
||||
|
||||
#define RUBY_RELEASE_DATE "2012-11-09"
|
||||
#define RUBY_RELEASE_DATE "2012-11-10"
|
||||
#define RUBY_RELEASE_YEAR 2012
|
||||
#define RUBY_RELEASE_MONTH 11
|
||||
#define RUBY_RELEASE_DAY 9
|
||||
#define RUBY_RELEASE_DAY 10
|
||||
|
||||
#include "ruby/version.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue