integrate cfgperl contents into mainline
[p5sagit/p5-mst-13.2.git] / t / op / pwent.t
index feee6f2..ca14a99 100755 (executable)
@@ -3,6 +3,11 @@
 BEGIN {
     chdir 't' if -d 't';
     unshift @INC, "../lib" if -d "../lib";
+    eval {my @n = getpwuid 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_pwd'} ne 'define') {
@@ -74,7 +79,11 @@ while (<PW>) {
        warn "# Your $where line $. is empty.\n";
        next;
     }
-    last if $n == $max;
+    if ($n == $max) {
+       local $/;
+       my $junk = <PW>;
+       last;
+    }
     # In principle we could whine if @s != 7 but do we know enough
     # of passwd file formats everywhere?
     if (@s == 7) {