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 | f4735faa34c70f1b392dee3e909c5f900084ba84 (patch) | |
tree | 653703ddc62ef4506e4f6ebdbd1a3c42114cfe92 /win32/win32.c | |
parent | bce06272b7de5d122ee1a21300cd29547dd6d7a8 (diff) |
* win32/win32.c (rb_w32_utime): allow NULL to set the current time.
[ruby-talk:219248]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/win32/win32.c b/win32/win32.c index e8ac1bbf07..0b58c19690 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3655,11 +3655,17 @@ rb_w32_utime(const char *path, 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({ |