Leopard has more standard /etc/passwd files than previous
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 29 Oct 2007 10:49:13 +0000 (10:49 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 29 Oct 2007 10:49:13 +0000 (10:49 +0000)
versions of darwin. Thanks to David Morel for testing.

p4raw-id: //depot/perl@32200

t/op/pwent.t

index 4d9de4490f124c3d05e5181773a27fd87a4e87fc..3303f3e41ed79a654a3643f48ee6ba0e25c86ed7 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);
-    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;