1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merges r29181 from trunk into ruby_1_9_2.

--
* file.c (rb_file_s_readlink): symlink target should be in
  filesystem encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2010-11-01 15:01:51 +00:00
parent 5e13dd7b53
commit 500be74c6a
4 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Sat Sep 4 23:48:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_readlink): symlink target should be in
filesystem encoding.
Wed Sep 1 14:33:36 2010 NARUSE, Yui <naruse@ruby-lang.org>
* enum.c (enum_zip): fix typo of rdoc.

2
file.c
View file

@ -2446,7 +2446,7 @@ rb_file_s_readlink(VALUE klass, VALUE path)
xfree(buf);
rb_sys_fail_path(path);
}
v = rb_tainted_str_new(buf, rv);
v = rb_filesystem_str_new(buf, rv);
xfree(buf);
return v;

View file

@ -354,11 +354,14 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_raise(Errno::EEXIST) { File.link(@file, @file) }
end
def test_symlink2
def test_readlink
return unless @symlinkfile
assert_equal(@file, File.readlink(@symlinkfile))
assert_raise(Errno::EINVAL) { File.readlink(@file) }
assert_raise(Errno::ENOENT) { File.readlink(@nofile) }
if fs = Encoding.find("filesystem")
assert_equal(fs, File.readlink(@symlinkfile).encoding)
end
rescue NotImplementedError
end

View file

@ -1,13 +1,13 @@
#define RUBY_VERSION "1.9.2"
#define RUBY_PATCHLEVEL 29
#define RUBY_PATCHLEVEL 30
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_YEAR 2010
#define RUBY_RELEASE_MONTH 10
#define RUBY_RELEASE_DAY 23
#define RUBY_RELEASE_DATE "2010-10-23"
#define RUBY_RELEASE_MONTH 11
#define RUBY_RELEASE_DAY 1
#define RUBY_RELEASE_DATE "2010-11-01"
#include "ruby/version.h"