From: Anton Yartsev Date: Tue, 5 May 2015 19:43:37 +0000 (+0000) Subject: [analyzer] This eliminates regression caused by r236423. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e073be178f327bc6bd81aa51017d07aca5f7886;p=clang [analyzer] This eliminates regression caused by r236423. 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 --- diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer index 5ee4f62615..8e12126e79 100755 --- a/tools/scan-build/ccc-analyzer +++ b/tools/scan-build/ccc-analyzer @@ -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;