Subject: | [patch] parse quoted attributes correctly |
--- RADIUS-UserFile-1.01/UserFile.pm Thu Dec 13 18:51:40 2001
+++ libradius-userfile-perl-1.01/UserFile.pm Thu May 16 07:48:47 2002
@@ -520,7 +521,9 @@
while ($raw =~ s/^(\S+)\s*=\s*(("[^"]*")|[^",\s]+)\s*,?//) {
if (defined $2) {
- push @attribs, $1, $2;
+ my( $attrib, $value ) = ( $1, $2 );
+ $value =~ s/(^"|"$)//g; #strip quotes
+ push @attribs, $attrib => $value;
}
else {
carp("Couldn't understand line $. in `$file'.");