summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--file.c13
-rw-r--r--lib/fileutils.rb2
-rw-r--r--version.h6
4 files changed, 19 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 97d28a6..f2285bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Mar 4 23:38:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_stat_s_utime): fixed a commit miss for the platforms
+ where utimes() does not exist.
+
+ * lib/fileutils.rb (touch): ditto.
+
Sun Mar 4 14:46:56 2007 WATANABE Hirofumi <eban@ruby-lang.org>
* util.c (push_element): should return a int value.
diff --git a/file.c b/file.c
index fbe0c84..e392cd7 100644
--- a/file.c
+++ b/file.c
@@ -2054,12 +2054,15 @@ rb_file_s_utime(argc, argv)
rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest);
- tv = rb_time_timeval(atime);
- utbuf.actime = tv.tv_sec;
- tv = rb_time_timeval(mtime);
- utbuf.modtime = tv.tv_sec;
+ if (!NIL_P(atime) || !NIL_P(mtime)) {
+ utp = &utbuf;
+ tv = rb_time_timeval(atime);
+ utp->actime = tv.tv_sec;
+ tv = rb_time_timeval(mtime);
+ utp->modtime = tv.tv_sec;
+ }
- n = apply2files(utime_internal, rest, &utbuf);
+ n = apply2files(utime_internal, rest, utp);
return LONG2FIX(n);
}
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 913b985..3fdb6cb 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1018,7 +1018,7 @@ module FileUtils
fu_check_options options, OPT_TABLE['touch']
list = fu_list(list)
created = nocreate = options[:nocreate]
- t = options[:mtime] || Time.now
+ t = options[:mtime]
if options[:verbose]
fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}"
end
diff --git a/version.h b/version.h
index 751b0d2..62778ba 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.6"
-#define RUBY_RELEASE_DATE "2007-03-03"
+#define RUBY_RELEASE_DATE "2007-03-04"
#define RUBY_VERSION_CODE 186
-#define RUBY_RELEASE_CODE 20070303
+#define RUBY_RELEASE_CODE 20070304
#define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 3
+#define RUBY_RELEASE_DAY 4
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];