Author: sparky
Date: Sun Jun 27 00:10:08 2010
New Revision: 11598

Modified:
   toys/rsget.pl/RSGet/Curl.pm
Log:
- quote arguments in callback


Modified: toys/rsget.pl/RSGet/Curl.pm
==============================================================================
--- toys/rsget.pl/RSGet/Curl.pm (original)
+++ toys/rsget.pl/RSGet/Curl.pm Sun Jun 27 00:10:08 2010
@@ -632,12 +632,19 @@
        return bignum( $supercurl->{size_got} ) . "; ${speed}KB/s $eta";
 }
 
+sub shquote
+{
+       local $_ = shift;
+       s/'/'"'"'/g;
+       return "'$_'";
+}
+
 sub callback
 {
        my $hook = shift;
        my %opts = @_;
 
-       $hook =~ s/(\...@{([a-z]*)})/$opts{ $2 } || $1/eg;
+       $hook =~ s/(\...@{([a-z]*)})/shquote( $opts{ $2 } || $1 )/eg;
 
        my $pid = fork;
        unless ( defined $pid ) {
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to