diff options
author | Steve Peters <steve@fisharerojo.org> | 2005-07-12 23:51:45 -0700 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2005-07-13 17:22:07 +0000 |
commit | da4b9520f5674bda37e255992f40bda369d504df (patch) | |
tree | 23649ff7def5201dbf2c4927d627011dfce4dfb7 /t/op/groups.t | |
parent | 0685228bc0e6f0ccd11501cab8ce8356eb5fd6bd (diff) | |
download | perl-da4b9520f5674bda37e255992f40bda369d504df.tar.gz |
[perl #9565] [PATCH] /op/groups.t bug
From: "Steve Peters via RT" <perlbug-followup@perl.org>
Message-ID: <rt-3.0.11-9565-117185.14.6331240065229@perl.org>
p4raw-id: //depot/perl@25140
Diffstat (limited to 't/op/groups.t')
-rwxr-xr-x | t/op/groups.t | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/t/op/groups.t b/t/op/groups.t index 6110fb8c4f..faaf7dd460 100755 --- a/t/op/groups.t +++ b/t/op/groups.t @@ -94,11 +94,11 @@ if ($groups =~ /groups=(.+)( [ug]id=|$)/) { my @g1; # prefer names over numbers for (@g0) { - # 42(zot me) + # 42(zot me) if (/^(\d+)(?:\(([^)]+)\))?/) { push @g1, ($2 || $1); } - # zot me(42) + # zot me(42) elsif (/^([^(]*)\((\d+)\)/) { push @g1, ($1 || $2); } @@ -129,15 +129,17 @@ for (split(' ', $()) { else { push(@gr, $_); } -} +} print "# gr = @gr\n"; +my %did; if ($^O =~ /^(?:uwin|cygwin|interix|solaris)$/) { # Or anybody else who can have spaces in group names. $gr1 = join(' ', grep(!$did{$_}++, sort split(' ', join(' ', @gr)))); } else { - $gr1 = join(' ', sort @gr); + # Don't assume that there aren't duplicate groups + $gr1 = join(' ', sort grep defined $_ && !$did{$_}++, @gr); } if ($Config{myuname} =~ /^cygwin_nt/i) { # basegroup on CYGWIN_NT has id = 0. |