mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Make config.pl more resistant to misuse
This commit is contained in:
@ -100,12 +100,12 @@ for my $line (@config_lines) {
|
|||||||
$line =~ s!^!//!;
|
$line =~ s!^!//!;
|
||||||
}
|
}
|
||||||
} elsif ($action eq "unset") {
|
} elsif ($action eq "unset") {
|
||||||
if (!$done && $line =~ /^\s*#define\s*$name/) {
|
if (!$done && $line =~ /^\s*#define\s*$name\b/) {
|
||||||
$line = '//' . $line;
|
$line = '//' . $line;
|
||||||
$done = 1;
|
$done = 1;
|
||||||
}
|
}
|
||||||
} elsif (!$done && $action eq "set") {
|
} elsif (!$done && $action eq "set") {
|
||||||
if ($line =~ m!^(?://)?\s*#define\s*$name!) {
|
if ($line =~ m!^(?://)?\s*#define\s*$name\b!) {
|
||||||
$line = "#define $name";
|
$line = "#define $name";
|
||||||
$line .= " $value" if defined $value && $value ne "";
|
$line .= " $value" if defined $value && $value ne "";
|
||||||
$line .= "\n";
|
$line .= "\n";
|
||||||
|
Reference in New Issue
Block a user