X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=bin%2Fblhc;fp=bin%2Fblhc;h=0c9360b360788163294b89e94b9832091c05b98c;hp=2f8da5f2c4efdda473a2e3d414f98e65f3d796c8;hb=80aa6479d0057222eadb9a01a6fde08f4a9f10c7;hpb=06b7783ef223d0f58804f3f08d27c45dc3b97351 diff --git a/bin/blhc b/bin/blhc index 2f8da5f..0c9360b 100755 --- a/bin/blhc +++ b/bin/blhc @@ -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