diff --git a/ChangeLog b/ChangeLog index 1f3fb53ffb..b1c18d9793 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Nov 28 09:28:30 2011 NAKAMURA Usaku + + * win32/win32.c (rb_w32_uchmod): typo. [Bug#5671] [ruby-dev:44898] + + * test/ruby/test_file.rb (TestFile#test_chmod_m17n): test of above bug. + Sun Nov 27 21:25:33 2011 KOSAKI Motohiro * configure.in: added -fno-strict-overflow. it suppress annoying diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index c40bf43e25..cc266a4c4a 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -195,4 +195,13 @@ class TestFile < Test::Unit::TestCase puts '#{bug5596}' EOS end + + def test_chmod_m17n + bug5671 = '[ruby-dev:44898]' + Dir.mktmpdir('test-file-chmod-m17n-') do |tmpdir| + file = File.join(tmpdir, "\u3042") + File.open(file, 'w'){} + assert_equal(File.chmod(0666, file), 1, bug5671) + end + end end diff --git a/win32/win32.c b/win32/win32.c index 3b2e58f5cd..5619c75b9f 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -6032,7 +6032,7 @@ rb_w32_uchmod(const char *path, int mode) WCHAR *wpath; int ret; - if (!(wpath = filecp_to_wstr(path, NULL))) + if (!(wpath = utf8_to_wstr(path, NULL))) return -1; ret = _wchmod(wpath, mode); free(wpath);