From 7f9049baf4caed031e2ccdcf41db9f687f568d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 23 Jun 2015 17:42:51 +0200 Subject: [PATCH] Make config.pl more resistant to misuse --- scripts/config.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config.pl b/scripts/config.pl index 71dd21733..f673c2aaf 100755 --- a/scripts/config.pl +++ b/scripts/config.pl @@ -100,12 +100,12 @@ for my $line (@config_lines) { $line =~ s!^!//!; } } elsif ($action eq "unset") { - if (!$done && $line =~ /^\s*#define\s*$name/) { + if (!$done && $line =~ /^\s*#define\s*$name\b/) { $line = '//' . $line; $done = 1; } } elsif (!$done && $action eq "set") { - if ($line =~ m!^(?://)?\s*#define\s*$name!) { + if ($line =~ m!^(?://)?\s*#define\s*$name\b!) { $line = "#define $name"; $line .= " $value" if defined $value && $value ne ""; $line .= "\n";