summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-02-16 13:16:54 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-02-16 13:16:54 +0900
commit551f1236a43ad014522d120dea1f136052879c0a (patch)
tree335a85d283743ee9623d2d6cc99e9fdb4be0a7ab
parent38f9c832e812f96fd06ca73688ff2baa528c119c (diff)
merge revision(s) a681c484a3c5b9235c84bc5c253b4406e498e8cf: [Backport #17626]
Fixed codepage for utime [Bug #17626] Should use the given codepage argument. Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org> --- test/ruby/test_file_exhaustive.rb | 7 +++++++ win32/win32.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
-rw-r--r--test/ruby/test_file_exhaustive.rb7
-rw-r--r--version.h2
-rw-r--r--win32/win32.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index ac11e0cc85..e2314424b3 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -679,6 +679,13 @@ class TestFileExhaustive < Test::Unit::TestCase
File.utime(t + 1, t + 2, zerofile)
assert_equal(t + 1, File.atime(zerofile))
assert_equal(t + 2, File.mtime(zerofile))
+ Dir.mktmpdir do |dir|
+ Dir.chdir do
+ path = "foo\u{30b3 30d4 30fc}"
+ File.write(path, "") rescue next
+ assert_equal(1, File.utime(nil, nil, path))
+ end
+ end
end
def test_utime_symlinkfile
diff --git a/version.h b/version.h
index 233bfafb70..8a90b78e40 100644
--- a/version.h
+++ b/version.h
@@ -12,7 +12,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 41
+#define RUBY_PATCHLEVEL 42
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 2
diff --git a/win32/win32.c b/win32/win32.c
index 5985875fe2..cfc571f145 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -7399,7 +7399,7 @@ wutimensat(int dirfd, const WCHAR *path, const struct timespec *times, int flags
static int
w32_utimensat(int dirfd, const char *path, const struct timespec *times, int flags, UINT cp)
{
- WCHAR *wpath = mbstr_to_wstr(filecp(), path, -1, NULL);
+ WCHAR *wpath = mbstr_to_wstr(cp, path, -1, NULL);
int ret = -1;
if (wpath) {