diff --git a/ChangeLog b/ChangeLog index b0241f839c..89978e916e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Mar 3 22:54:33 2007 Minero Aoki + + * lib/fileutils.rb (touch): last #touch change causes error when + :mtime option was not given. + Sat Mar 3 22:51:29 2007 Minero Aoki * 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|