]> granicus.if.org Git - clang/commitdiff
[analyzer] This eliminates regression caused by r236423.
authorAnton Yartsev <anton.yartsev@gmail.com>
Tue, 5 May 2015 19:43:37 +0000 (19:43 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Tue, 5 May 2015 19:43:37 +0000 (19:43 +0000)
Wrap an argument with quotes only if it has spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236533 91177308-0d34-0410-b5e6-96231b3b80d8

tools/scan-build/ccc-analyzer

index 5ee4f626151bff4a221fa891cc17ef5bcdb56053..8e12126e79307dc1ccc6bb4e7ed42cb43c7257cc 100755 (executable)
@@ -179,7 +179,11 @@ sub GetCCArgs {
   die "could not find clang line\n" if (!defined $line);
   # Strip leading and trailing whitespace characters.
   $line =~ s/^\s+|\s+$//g;
-  my @items = quotewords('\s+', 1, $line);
+  my @items = quotewords('\s+', 0, $line);
+  # Wrap arguments that have spaces with quotes.
+  foreach (@items) {
+    $_ = qq/"$_"/ if (/\s+/);
+  }
   my $cmd = shift @items;
   die "cannot find 'clang' in 'clang' command\n" if (!($cmd =~ /clang/));
   return \@items;