SVN: toys/rsget.pl/RSGet/Curl.pm
sparky
sparky at pld-linux.org
Sun Jun 27 00:10:08 CEST 2010
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 ) {
More information about the pld-cvs-commit
mailing list