This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
tolerate whitespace in /etc/group entries (suggested by Jarkko
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 2 Oct 1998 02:02:19 +0000 (02:02 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 2 Oct 1998 02:02:19 +0000 (02:02 +0000)
Hietaniemi)

p4raw-id: //depot/perl@1906

t/op/grent.t

index a04b51b..70b4ce0 100755 (executable)
@@ -29,7 +29,7 @@ while (<GR>) {
     @s = split /:/;
     if (@s == 4) {
        my ($name_s,$passwd_s,$gid_s,$members_s) = @s;
-       $members_s =~ s/ /,/g;
+       $members_s =~ s/\s*,\s*/,/g;
        @n = getgrgid($gid_s);
        # 'nogroup' et al.
        next unless @n;
@@ -40,7 +40,7 @@ while (<GR>) {
            ($name,$passwd,$gid,$members) = @n;
            next if $name_s ne $name;
        }
-       $members =~ s/ /,/g;
+       $members =~ s/\s+/,/g;
        $not = 1, last
            if $name    ne $name_s    or
 # Shadow passwords confuse this.