$ENV{PATH} ="/bin:/usr/bin:/usr/xpg4/bin:/usr/ucb" .
exists $ENV{PATH} ? ":$ENV{PATH}" : "";
$ENV{LC_ALL} = "C"; # so that external utilities speak English
+$ENV{LANGUAGE} = 'C'; # GNU locale extension
sub quit {
- print "1..0\n";
+ print "1..0 # Skip: no `id` or `groups`\n";
exit 0;
}
-quit() if $^O eq 'MSWin32';
+quit() if $^O eq 'MSWin32' or $^O =~ /lynxos/i;
# We have to find a command that prints all (effective
# and real) group names (not ids). The known commands are:
quit();
}
+unless (eval { getgrgid(0); 1 }) {
+ print "1..0 # Skip: getgrgid() not implemented\n";
+ exit 0;
+}
+
# Remember that group names can contain whitespace, '-', et cetera.
# That is: do not \w, do not \S.
if ($groups =~ /groups=(.+)( [ug]id=|$)/) {
# prefer names over numbers
for (@g0) {
# 42(zot me)
- if (/^(\d+)(?:\(([^)]+)\))?$/) {
+ if (/^(\d+)(?:\(([^)]+)\))?/) {
push @g1, ($2 || $1);
}
# zot me(42)
- elsif (/^([^(]*)\((\d+)\)$/) {
+ elsif (/^([^(]*)\((\d+)\)/) {
push @g1, ($1 || $2);
}
else {