Changeset 314 for LATMOS-Accounts/lib/LATMOS/Accounts/Acls.pm
- Timestamp:
- 08/08/09 16:25:16 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Acls.pm
r310 r314 59 59 my $acl; 60 60 my $line_nb = 0; 61 my $prevline = ""; 61 62 if (open(my $handle, '<', $file)) { 62 63 while(my $realline = <$handle>) { 63 64 $line_nb++; 64 my $line = $realline; # keep track to report malformed file 65 chomp($realline); 66 if ($realline =~ /\\$/) { 67 # continuation line 68 $prevline .= $realline; 69 $prevline =~ s/\s*\\$//; 70 next; 71 } 72 my $line = $prevline . $realline; # keep track to report malformed file 73 $prevline = ""; 65 74 $line =~ s/\s*#.*//; 66 if ($line =~ /^(\S +)\s*$/) {75 if ($line =~ /^(\S.*)/) { 67 76 if ($acl) { 68 77 push(@{$self->{_acls}}, $acl); … … 73 82 return; 74 83 }; 75 } elsif ($line =~ / \s+(\S+)/) {84 } elsif ($line =~ /^\s+(\S.*)/) { 76 85 if ($acl) { 77 86 $acl->add_perm($line) or do { … … 121 130 sub new { 122 131 my ($class, $objdotatt, $list) = @_; 123 my ($obj, $attr) = $objdotatt =~ /^([^.]+)\.( \S+)/;132 my ($obj, $attr) = $objdotatt =~ /^([^.]+)\.(.*)/; 124 133 my @attrs = ($attr =~ /^\{(.*)\}$/) 125 ? (split( ',', $1))134 ? (split(/\s*,\s*/, $1)) 126 135 : ($attr); 127 136 @attrs or return;
Note: See TracChangeset
for help on using the changeset viewer.