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 | 42e6d68f012f4ed6be495fd662eb5e19d44d2235 (patch) | |
tree | 3f1bc5dfa3801d6485da2e4299b368adac6645bc /lib | |
parent | b9d980d4ba7fe0cee89abb49da4659bf69718205 (diff) | |
download | ruby-42e6d68f012f4ed6be495fd662eb5e19d44d2235.tar.gz ruby-42e6d68f012f4ed6be495fd662eb5e19d44d2235.tar.xz ruby-42e6d68f012f4ed6be495fd662eb5e19d44d2235.zip |
* lib/fileutils.rb (touch): last #touch change causes error when :mtime option was not given.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fileutils.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 386ea35f8..73ee07202 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| |