quote metacharacters in pattern to fix strip issue if metacharacters exist
authorZhang Qiang <qiang.z.zhang@intel.com>
Thu, 2 May 2013 01:40:48 +0000 (09:40 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Thu, 2 May 2013 02:05:27 +0000 (10:05 +0800)
Change-Id: Iced588ef2dcc7f96cb7181c41e987eb0e3c0c1f7

depanneur

index 321aead470223b0eb51f77ffc76216800e7da1a9..12c62818607c653c27f0026e098d586d1e1039b6 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -585,9 +585,9 @@ sub prepare_git {
         my $tmp_dir = abs_path(tempdir(CLEANUP=>1));
         my $tmp_spec = "$tmp_dir/$spec_file";
         my $without_base = $spec;
-        $without_base =~ s!$base/!!;
+        $without_base =~ s!\Q$base\E/!!;
         if (my_system("cd $base; git show $commit:$without_base >$tmp_spec 2>/dev/null") != 0) {
-            warning("failed to checkout spec file from commit: $commit");
+            warning("failed to checkout spec file from commit: $commit:$without_base");
             return;
         }
         $spec = $tmp_spec;