From b3b3c04f73aa5eb196cb2940dbfd0d2311f01bb3 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 28 Dec 2009 18:25:43 +0000 Subject: [PATCH] Replaced regex gibberish with quotemeta --- modules/cdecl.pl | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/modules/cdecl.pl b/modules/cdecl.pl index 540b36a1..5d03e075 100755 --- a/modules/cdecl.pl +++ b/modules/cdecl.pl @@ -10,21 +10,8 @@ if ($#ARGV < 0) { my $command = join(' ', @ARGV); -$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; -$command =~ s/\?/\\?/g; - +$command = quotemeta($command); +$command =~ s/\\ / /g; #print "[$command]\n"; my $result = `/usr/bin/cdecl -c $command`;