This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate perlhist entries for 5.8.6 and its perldelta to blead
[perl5.git] / t / op / pwent.t
index 0d3c11b..4d9de44 100755 (executable)
@@ -49,6 +49,18 @@ BEGIN {
        }
     }
 
+    if (not defined $where) {      # Try NIS+
+     foreach my $niscat (qw(/bin/niscat)) {
+         if (-x $niscat &&
+           open(PW, "$niscat passwd.org_dir 2>/dev/null |") &&
+           defined(<PW>)) {
+           $where = "NIS+ $niscat passwd.org_dir";
+           undef $reason;
+           last;
+         }
+     }
+    }
+
     if ($reason) {     # Give up.
        print "1..0 # Skip: $reason\n";
        exit 0;
@@ -123,7 +135,7 @@ endpwent();
 
 print "# max = $max, n = $n, perfect = ", scalar keys %perfect, "\n";
 
-if (keys %perfect == 0) {
+if (keys %perfect == 0 && $n) {
     $max++;
     print <<EOEX;
 #