[inseparable changes from match from perl-5.003_97b to perl-5.003_97c]
[perl.git] / mg.c
diff --git a/mg.c b/mg.c
index 54ca044..1355740 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1536,7 +1536,8 @@ MAGIC* mg;
                    break;
                gary[i] = I_V(atof(p));
            }
-           (void)setgroups(i, gary);
+           if (i)
+               (void)setgroups(i, gary);
        }
 #else  /* HAS_SETGROUPS */
        egid = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);