From 02f61f874af05058b3f0ee2f59729668ced59cd4 Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 9 Jul 2013 07:01:59 +0000 Subject: [PATCH] * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user and group are both nil, print ":". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/fileutils.rb | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c07ec7938a..dfdf9e318c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jul 9 15:03:24 2013 Akinori MUSHA + + * 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 * 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)