This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Leopard has more standard /etc/passwd files than previous
[perl5.git] / t / op / pwent.t
index 4d9de44..3303f3e 100755 (executable)
@@ -89,7 +89,8 @@ while (<PW>) {
     # LIMIT -1 so that users with empty shells don't fall off
     my @s = split /:/, $_, -1;
     my ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s);
     # LIMIT -1 so that users with empty shells don't fall off
     my @s = split /:/, $_, -1;
     my ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s);
-    if ($^O eq 'darwin') {
+    (my $v) = $Config{osvers} =~ /^(\d+)/;
+    if ($^O eq 'darwin' && $v < 9) {
        ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s) = @s[0,1,2,3,7,8,9];
     } else {
        ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s) = @s;
        ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s) = @s[0,1,2,3,7,8,9];
     } else {
        ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s) = @s;