summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-18 14:03:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-18 14:03:43 +0000
commit6a5c50b05d741b728412c4d5f2ef2258272bb585 (patch)
tree653703ddc62ef4506e4f6ebdbd1a3c42114cfe92
parent5c25eac5a8d0832ea0b8fc1881b5cdd9e4ab5e1e (diff)
downloadruby-6a5c50b05d741b728412c4d5f2ef2258272bb585.tar.gz
ruby-6a5c50b05d741b728412c4d5f2ef2258272bb585.tar.xz
ruby-6a5c50b05d741b728412c4d5f2ef2258272bb585.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/branches/ruby_1_8@11189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--win32/win32.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index cccdcd1d3..a9c40934a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 00:55:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (parser_yylex): use particular enums. [ruby-core:09221]
diff --git a/win32/win32.c b/win32/win32.c
index e8ac1bbf0..0b58c1969 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({