Change 26791 by [EMAIL PROTECTED] on 2006/01/11 20:50:30
Make $( and $) list the groups in the order they
are returned from the OS. Linux seems to return
the gids sorted and it seemed wrong for perl to
reverse this order.
Affected files ...
... //depot/perl/mg.c#403 edit
Differences ...
==== //depot/perl/mg.c#403 (text) ====
Index: perl/mg.c
--- perl/mg.c#402~26786~ 2006-01-11 06:23:28.000000000 -0800
+++ perl/mg.c 2006-01-11 12:50:30.000000000 -0800
@@ -1011,12 +1011,11 @@
#ifdef HAS_GETGROUPS
{
Groups_t *gary = NULL;
- I32 num_groups = getgroups(0, gary);
+ I32 i, num_groups = getgroups(0, gary);
Newx(gary, num_groups, Groups_t);
num_groups = getgroups(num_groups, gary);
- while (--num_groups >= 0)
- Perl_sv_catpvf(aTHX_ sv, " %"IVdf,
- (IV)gary[num_groups]);
+ for (i = 0; i < num_groups; i++)
+ Perl_sv_catpvf(aTHX_ sv, " %"IVdf, (IV)gary[i]);
Safefree(gary);
}
(void)SvIOK_on(sv); /* what a wonderful hack! */
End of Patch.