Be more fault-tolerant when reading checkgroups.

* Accept lines starting with whitespace.

* Drop empty "groups", i.e. lines containing only
  whitespace.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2012-05-27 15:33:11 +02:00
parent 0dc13b3980
commit 7662b1065e

View file

@ -230,8 +230,9 @@ sub ReadGroupList {
my %ValidGroups; my %ValidGroups;
open (my $LIST,"<$Filename") or &Bleat(2,"Cannot read $Filename: $!"); open (my $LIST,"<$Filename") or &Bleat(2,"Cannot read $Filename: $!");
while (<$LIST>) { while (<$LIST>) {
s/^(\S+).*$/$1/; s/^\s*(\S+).*$/$1/;
chomp; chomp;
next if /^$/;
$ValidGroups{$_} = '1'; $ValidGroups{$_} = '1';
}; };
close $LIST; close $LIST;