Fixed "config.pl get" for options with no value

Between 2.5.0 and 2.6.0, "scripts/config.pl get MBEDTLS_XXX" was fixed
for config.h lines with a comment at the end, but that broke the case
of macros with an empty expansion. Support all cases.
This commit is contained in:
Gilles Peskine 2017-10-09 16:51:24 +02:00 committed by Simon Butcher
parent bd9d42c236
commit f0f55ccb72

View File

@ -205,7 +205,7 @@ for my $line (@config_lines) {
$done = 1;
}
} elsif (!$done && $action eq "get") {
if ($line =~ /^\s*#define\s*$name\s*([^\s]+)\s*\b/) {
if ($line =~ /^\s*#define\s*$name(?:\s+(.*?))\s*(?:$|\/\*|\/\/)/) {
$value = $1;
$done = 1;
}