$ENV{LC_ALL} = "C"; # so that external utilities speak English
$ENV{LANGUAGE} = 'C'; # GNU locale extension
+BEGIN {
+ chdir 't';
+ @INC = '../lib';
+
+ require Config;
+ if ($@) {
+ print "1..0 # Skip: no Config\n";
+ } else {
+ Config->import;
+ }
+}
+
sub quit {
print "1..0 # Skip: no `id` or `groups`\n";
exit 0;
}
+unless (eval { getgrgid(0); 1 }) {
+ print "1..0 # Skip: getgrgid() not implemented\n";
+ exit 0;
+}
+
quit() if (($^O eq 'MSWin32' || $^O eq 'NetWare') or $^O =~ /lynxos/i);
# We have to find a command that prints all (effective
#
# If these tests fail, report the particular incantation you use
# on this platform to find *all* the groups that an arbitrary
-# luser may belong to, using the 'perlbug' program.
+# user may belong to, using the 'perlbug' program.
EOM
}
last GROUPS;
quit();
}
-unless (eval { getgrgid(0); 1 }) {
- print "1..0 # Skip: getgrgid() not implemented\n";
- exit 0;
-}
-
chomp($groups);
print "# groups = $groups\n";
$pwgid = $( + 0;
($pwgnam) = getgrgid($pwgid);
-if ($^O eq 'cygwin') { # basegroup on Cygwin has id = 0.
+if ($Config{myuname} =~ /^cygwin_nt/i) { # basegroup on CYGWIN_NT has id = 0.
@basegroup{$pwgid,$pwgnam} = (0,0);
} else {
@basegroup{$pwgid,$pwgnam} = (1,1);