diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-03 13:54:54 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-03 13:54:54 +0000 |
commit | 738bf0e8a44a3f5c297aec118638684d910f3323 (patch) | |
tree | 3f1bc5dfa3801d6485da2e4299b368adac6645bc | |
parent | e089d1161da7e51f78a49a23c290cfcc30ee2457 (diff) | |
download | ruby-738bf0e8a44a3f5c297aec118638684d910f3323.tar.gz |
* lib/fileutils.rb (touch): last #touch change causes error when :mtime option was not given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/fileutils.rb | 8 |
2 files changed, 7 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Sat Mar 3 22:54:33 2007 Minero Aoki <aamine@loveruby.net> + + * lib/fileutils.rb (touch): last #touch change causes error when + :mtime option was not given. + Sat Mar 3 22:51:29 2007 Minero Aoki <aamine@loveruby.net> * lib/fileutils.rb (mv): could not move directory between diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 386ea35f81..73ee072024 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1012,13 +1012,9 @@ module FileUtils fu_check_options options, OPT_TABLE['touch'] list = fu_list(list) created = nocreate = options[:nocreate] - t = options[:mtime] + t = options[:mtime] || Time.now if options[:verbose] - fu_output_message "touch #{ - nocreate ? ' -c' : '' - }#{ - t ? t.strftime(' -t %Y%m%d%H%M.%S') : '' - }#{list.join ' '}" + fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}" end return if options[:noop] list.each do |path| |