diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-18 14:03:43 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-18 14:03:43 +0000 |
| commit | 4313ef8980e41df56839bd7dd92826bd8981c525 (patch) | |
| tree | 0ea51d192c41eaeba7f6023b7b625cdfd21942ff | |
| parent | 62bdf015bf30a2f7745169a0299d32f92b683fdc (diff) | |
| download | ruby-4313ef8980e41df56839bd7dd92826bd8981c525.tar.gz ruby-4313ef8980e41df56839bd7dd92826bd8981c525.tar.xz ruby-4313ef8980e41df56839bd7dd92826bd8981c525.zip | |
* win32/win32.c (rb_w32_utime): allow NULL to set the current time.
[ruby-talk:219248]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | win32/win32.c | 14 |
2 files changed, 14 insertions, 5 deletions
@@ -1,9 +1,12 @@ -Wed Oct 18 22:58:27 2006 Nobuyoshi Nakada <nobu@ruby-lang.org> +Wed Oct 18 23:02:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org> * array.c (rb_ary_shift): shorten copy size. fixed: [ruby-list:42907] * signal.c (Init_signal): handle SIGTERM. fixed: [ruby-list:42895] + * win32/win32.c (rb_w32_utime): allow NULL to set the current time. + [ruby-talk:219248] + Wed Oct 18 13:25:50 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * string.c (rb_str_each_line): String#lines now works when a block diff --git a/win32/win32.c b/win32/win32.c index de0da968f..7c7f310bb 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4117,11 +4117,17 @@ rb_w32_utime(const char *path, const struct utimbuf *times) return -1; } - if (unixtime_to_filetime(times->actime, &atime)) { - return -1; + if (times) { + if (unixtime_to_filetime(times->actime, &atime)) { + return -1; + } + if (unixtime_to_filetime(times->modtime, &mtime)) { + return -1; + } } - if (unixtime_to_filetime(times->modtime, &mtime)) { - return -1; + else { + GetSystemTimeAsFileTime(&atime); + mtime = atime; } RUBY_CRITICAL({ |
