From: Steve Peters Date: Wed, 13 Jul 2005 06:51:45 +0000 (-0700) Subject: [perl #9565] [PATCH] /op/groups.t bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da4b9520f5674bda37e255992f40bda369d504df;p=p5sagit%2Fp5-mst-13.2.git [perl #9565] [PATCH] /op/groups.t bug From: "Steve Peters via RT" Message-ID: p4raw-id: //depot/perl@25140 --- diff --git a/t/op/groups.t b/t/op/groups.t index 6110fb8..faaf7dd 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.