]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
escape pattern unless it's prefixed with ~
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 7 Jan 2015 17:30:15 +0000 (11:30 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 7 Jan 2015 23:30:05 +0000 (17:30 -0600)
support-d/utils/hashfinder

index f6ec9df3e46044a96cfbccd4133249df57df12b2..88df4ce5cc1b1c4cfe97b5d99eca9064ee994c07 100755 (executable)
@@ -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;