X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fblhc;h=e3c14b4cdcd668b6ad8b99f7641846a02c0876f7;hb=65d6d7541a860d1523fdcee94b81db2d7a59317c;hp=2f8da5f2c4efdda473a2e3d414f98e65f3d796c8;hpb=06b7783ef223d0f58804f3f08d27c45dc3b97351;p=blhc%2Fblhc.git diff --git a/bin/blhc b/bin/blhc index 2f8da5f..e3c14b4 100755 --- a/bin/blhc +++ b/bin/blhc @@ -24,7 +24,7 @@ use warnings; use Getopt::Long (); use Text::ParseWords (); -our $VERSION = '0.12'; +our $VERSION = '0.13'; # CONSTANTS/VARIABLES @@ -1022,9 +1022,29 @@ foreach my $file (@ARGV) { $complete_line = undef; } + my $noenv = $line; + # Strip (basic) environment variables for compiler detection. This + # prevents false positives when environment variables contain + # compiler binaries. Nested quotes, command substitution, etc. is + # not supported. + $noenv =~ s/^ + \s* + (?: + [a-zA-Z_]+ # environment variable name + = + (?: + [^\s"'\$`\\]+ # non-quoted string + | + '[^"'\$`\\]*' # single-quoted string + | + "[^"'\$`\\]*" # double-quoted string + ) + \s+ + )* + //x; # Ignore lines with no compiler commands. next if not $non_verbose - and not $line =~ /$cc_regex_normal/o; + and not $noenv =~ /$cc_regex_normal/o; # Ignore lines with no filenames with extensions. May miss some # non-verbose builds (e.g. "gcc -o test" [sic!]), but shouldn't be # a problem as the log will most likely contain other non-verbose