]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Correctly handle files with "c++" in their name.
authorSimon Ruderich <simon@ruderich.org>
Tue, 13 Mar 2012 22:43:48 +0000 (23:43 +0100)
committerSimon Ruderich <simon@ruderich.org>
Tue, 13 Mar 2012 22:43:48 +0000 (23:43 +0100)
Names like "c++defs.h-t" and "c++defs.h" are used by some build scripts.

bin/blhc
t/logs/c++
t/tests.t

index 030dd2128be0dfee9b34e066914949eb5d380700..383fcc15f06b0d0a3ea750d6104e4d9357fbd023 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -224,7 +224,7 @@ while (my $line = <>) {
 
         } else {
             # Ignore lines with no compiler commands.
 
         } else {
             # Ignore lines with no compiler commands.
-            next if $line !~ /\b(cc\b|gcc\b|g\+\+|c\+\+)/;
+            next if $line !~ /\b(cc|gcc|g\+\+|c\+\+)(\s|\\)/;
 
             # Ignore false positives.
             #
 
             # Ignore false positives.
             #
index 21e9a29a9aba477958829023bb241cc1b578b803..76a9e95ff479df19b60cb7dabce76ad5224a46dc 100644 (file)
@@ -9,3 +9,7 @@ c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-securit
 c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
 test-d.cc:47:11: warning: unused variable 'test' [-Wunused-variable]
 c++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
 c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
 test-d.cc:47:11: warning: unused variable 'test' [-Wunused-variable]
 c++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
+
+rm c++test.h
+c++\
+    test.c
index 1d40f82750576a1bd7b98003b3d516553df2b2ab..f122c2527c3a3733d5c6cf2e575262b827942a80 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -306,6 +306,8 @@ CFLAGS missing (--param=ssp-buffer-size=4 -fPIE): c++ -g -O2 -fstack-protector -
 CFLAGS missing (-Werror=format-security -fPIE): c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
 CFLAGS missing (-fPIE): c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
 LDFLAGS missing (-Wl,-z,relro -fPIE -pie -Wl,-z,now): c++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
 CFLAGS missing (-Werror=format-security -fPIE): c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
 CFLAGS missing (-fPIE): c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
 LDFLAGS missing (-Wl,-z,relro -fPIE -pie -Wl,-z,now): c++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
+CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE): c++\\     test.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): c++\\     test.c
 ";
 
 
 ";