From: Anthony Minessale Date: Wed, 7 Jan 2015 17:30:15 +0000 (-0600) Subject: escape pattern unless it's prefixed with ~ X-Git-Tag: v1.4.16~1^2~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe305074f1b2cf9d02efec214f699e44ce0c1e3f;p=thirdparty%2Ffreeswitch.git escape pattern unless it's prefixed with ~ --- diff --git a/support-d/utils/hashfinder b/support-d/utils/hashfinder index f6ec9df3e4..88df4ce5cc 100755 --- a/support-d/utils/hashfinder +++ b/support-d/utils/hashfinder @@ -48,8 +48,11 @@ sub doit($$) { my $loops = shift || 0; my $linematch = 0; - $pattern =~ s/\(/\\\(/g; - $pattern =~ s/\)/\\\)/g; + if ($pattern =~ /^\~(.*)/) { + $pattern = $1; + } else { + $pattern = quotemeta $pattern; + } if ($pattern =~ /^(\d+)$/) { $linematch = 1;