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

sparky sparky at pld-linux.org
Fri Oct 9 23:21:38 CEST 2009


Author: sparky
Date: Fri Oct  9 23:21:38 2009
New Revision: 10744

Modified:
   toys/rsget.pl/RSGet/Dispatch.pm
Log:
- better get_slots


Modified: toys/rsget.pl/RSGet/Dispatch.pm
==============================================================================
--- toys/rsget.pl/RSGet/Dispatch.pm	(original)
+++ toys/rsget.pl/RSGet/Dispatch.pm	Fri Oct  9 23:21:38 2009
@@ -111,10 +111,14 @@
 {
 	my $cmd = shift;
 	my $suggested = shift;
-	return setting( "max_slots" ) if $cmd eq "check";
+	my $max = setting( "max_slots" );
+	return $max if $cmd eq "check";
 	return 1 unless defined $suggested;
-	return 0 + $suggested if $suggested =~ /^\d+$/;
-	return setting( "max_slots" ) if lc $suggested eq "max";
+	if ( $suggested =~ /^\d+$/ ) {
+		return $max if $max < $suggested;
+		return 0 | $suggested;
+	}
+	return $max if lc $suggested eq "max";
 	warn "Invalid slots declaration: $suggested\n" if verbose( 1 );
 	return 1;
 }


More information about the pld-cvs-commit mailing list