suppress scalar leak messages for known leaks (from
[p5sagit/p5-mst-13.2.git] / t / op / grent.t
index 9b06f11..761d8b9 100755 (executable)
@@ -3,6 +3,11 @@
 BEGIN {
     chdir 't' if -d 't';
     unshift @INC, "../lib" if -d "../lib";
+    eval {my @n = getgrgid 0};
+    if ($@ && $@ =~ /(The \w+ function is unimplemented)/) {
+       print "1..0 # Skip: $1\n";
+       exit 0;
+    }
     eval { require Config; import Config; };
     my $reason;
     if ($Config{'i_grp'} ne 'define') {
@@ -72,7 +77,11 @@ while (<GR>) {
        warn "# Your $where line $. is empty.\n";
        next;
     }
-    last if $n == $max;
+    if ($n == $max) {
+       local $/;
+       my $junk = <GR>;
+       last;
+    }
     # In principle we could whine if @s != 4 but do we know enough
     # of group file formats everywhere?
     if (@s == 4) {