diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/fileutils.rb | 8 |
2 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Tue Jul 9 15:03:24 2013 Akinori MUSHA <knu@iDaemons.org> + + * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user + and group are both nil, print ":". + Tue Jul 9 12:47:08 2013 Masaki Matsushita <glass.saga@gmail.com> * io.c (appendline): use READ_CHAR_PENDING_XXX macros and diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 806ee2544f..86d959046b 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1044,8 +1044,8 @@ module FileUtils def chown(user, group, list, options = {}) fu_check_options options, OPT_TABLE['chown'] list = fu_list(list) - fu_output_message sprintf('chown %s%s', - (group ? [user,group].join(':') : user) + ' ', + fu_output_message sprintf('chown %s %s', + (group ? "#{user}:#{group}" : user || ':'), list.join(' ')) if options[:verbose] return if options[:noop] uid = fu_get_uid(user) @@ -1073,9 +1073,9 @@ module FileUtils def chown_R(user, group, list, options = {}) fu_check_options options, OPT_TABLE['chown_R'] list = fu_list(list) - fu_output_message sprintf('chown -R%s %s%s', + fu_output_message sprintf('chown -R%s %s %s', (options[:force] ? 'f' : ''), - (group ? [user,group].join(':') : user) + ' ', + (group ? "#{user}:#{group}" : user || ':'), list.join(' ')) if options[:verbose] return if options[:noop] uid = fu_get_uid(user) |