diff options
| author | Anton Yartsev <anton.yartsev@gmail.com> | 2014-01-23 14:12:48 +0000 |
|---|---|---|
| committer | Anton Yartsev <anton.yartsev@gmail.com> | 2014-01-23 14:12:48 +0000 |
| commit | 0cb7c8abc11c9ba3ed08eb9444a49fb04d826eed (patch) | |
| tree | a2d2d46f668f90396ae6d20b565c9589825b8a3a | |
| parent | 55c625f2228584aa79ddadf878737095734211fb (diff) | |
| download | bcm5719-llvm-0cb7c8abc11c9ba3ed08eb9444a49fb04d826eed.tar.gz bcm5719-llvm-0cb7c8abc11c9ba3ed08eb9444a49fb04d826eed.zip | |
[analyzer] Strip trailing whitespace characters from input.
More universal way of removing trailing whitespace characters then 'chomp' does. Chomp "removes any trailing string that corresponds to the current value of $/" (quote from perldoc). In my case an input ended with '\r\r\n', chomp left '\r' at the end of input and the script ended up with an error "Use of uninitialized value in concatenation (.) or string"
llvm-svn: 199892
| -rwxr-xr-x | clang/tools/scan-build/ccc-analyzer | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/tools/scan-build/ccc-analyzer b/clang/tools/scan-build/ccc-analyzer index 220452f0d00..1522af824d1 100755 --- a/clang/tools/scan-build/ccc-analyzer +++ b/clang/tools/scan-build/ccc-analyzer @@ -158,9 +158,8 @@ sub GetCCArgs { close(FROM_CHILD); die "could not find clang line\n" if (!defined $line); - # Strip the newline and initial whitspace - chomp $line; - $line =~ s/^\s+//; + # Strip leading and trailing whitespace characters. + $line =~ s/^\s+|\s+$//g; my @items = quotewords('\s+', 0, $line); my $cmd = shift @items; die "cannot find 'clang' in 'clang' command\n" if (!($cmd =~ /clang/)); |

