[analyzer] This eliminates regression caused by r236423.

Wrap an argument with quotes only if it has spaces.

llvm-svn: 236533
This commit is contained in:
Anton Yartsev 2015-05-05 19:43:37 +00:00
parent 5722c0f192
commit 22f6189fb0
1 changed files with 5 additions and 1 deletions

View File

@ -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;