Commit 749a51b9 authored by Leigh Stoller's avatar Leigh Stoller

Minor addition for escaping shell arguments.

parent 3c5e82d6
......@@ -1151,5 +1151,20 @@ sub ClearNoDelete($)
return ($? ? -1 : 0);
}
sub escapeshellarg($)
{
my ($str) = @_;
my @chars = split('', $str);
my $result = "";
foreach my $ch (@chars) {
if ($ch eq '\'') {
$result = $result . "\'\\\'";
}
$result = $result . "$ch";
}
return "'$result'";
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment