3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-22 18:52:40 +01:00

Replaced regex gibberish with quotemeta

This commit is contained in:
Pragmatic Software 2009-12-28 18:25:43 +00:00
parent 0275e90dc8
commit b3b3c04f73

View File

@ -10,21 +10,8 @@ if ($#ARGV < 0) {
my $command = join(' ', @ARGV);
$command =~ s/-[^ ]+//g;
$command = quotemeta($command);
$command =~ s/\\ / /g;
$command =~ s/;/\\;/g;
$command =~ s/\(/\\(/g;
$command =~ s/\)/\\)/g;
$command =~ s/\$/\\\$/g;
$command =~ s/\[/\\[/g;
$command =~ s/\]/\\]/g;
$command =~ s/\|/\\|/g;
$command =~ s/'/\\'/g;
$command =~ s/`/\\`/g;
$command =~ s/,/\\,/g;
$command =~ s/\*/\\*/g;
$command =~ s/\?/\\?/g;
#print "[$command]\n";
my $result = `/usr/bin/cdecl -c $command`;