SVN: toys/rsget.pl/RSGet/Form.pm

sparky sparky at pld-linux.org
Sat Jun 5 00:18:18 CEST 2010


Author: sparky
Date: Sat Jun  5 00:18:17 2010
New Revision: 11531

Modified:
   toys/rsget.pl/RSGet/Form.pm
Log:
- improved split_attributes() - required for TurboBit


Modified: toys/rsget.pl/RSGet/Form.pm
==============================================================================
--- toys/rsget.pl/RSGet/Form.pm	(original)
+++ toys/rsget.pl/RSGet/Form.pm	Sat Jun  5 00:18:17 2010
@@ -121,21 +121,20 @@
 {
 	local $_ = shift;
 	my %attr;
-	while ( s/^\s*([a-z0-9_]+)([=\s])//i ) {
+	while ( s/^\s*([a-z0-9_]+)//i ) {
 		my $name = lc $1;
-		my $eq = $2;
-		if ( $eq eq "=" ) {
+		if ( s/^\s*=// ) {
 			my $value;
-			if ( s/^(["'])// ) {
+			if ( s/^\s*(["'])// ) {
 				my $quot = $1;
 				s/^(.*?)$quot//;
 				$value = $1;
 			} else {
-				s/(\S+)//;
+				s/^\s*(\S+)//;
 				$value = $1;
 			}
 			$attr{ $name } = defined $value ? de_ml( $value ) : "";
-		} else {
+		} elsif ( s/^\s+// ) {
 			$attr{ $name } = $name;
 		}
 	}


More information about the pld-cvs-commit mailing list