busybox: fix handling of special characters in path when converting menuconfig
authorFelix Fietkau <nbd@openwrt.org>
Sun, 3 Jan 2016 11:36:38 +0000 (11:36 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 3 Jan 2016 11:36:38 +0000 (11:36 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 48077

package/utils/busybox/convert_menuconfig.pl

index fd99349b65c8910dc3b87d1d06cb1dc6df7037fb..7342fbd8a1bd7385694277bb24036f4a2cdd2de8 100755 (executable)
@@ -16,9 +16,10 @@ open FIND, "find \"$PATH\" -name Config.in |";
 while (<FIND>) {
        chomp;
        my $input = $_;
-       s/^$PATH\///g;
-       s/sysdeps\/linux\///g;
-       my $output = $_;
+       my $output = $input;
+       my $replace = quotemeta($PATH);
+       $output =~ s/^$replace\///g;
+       $output =~ s/sysdeps\/linux\///g;
        print STDERR "$input => $output\n";
        $output =~ /^(.+)\/[^\/]+$/ and system("mkdir -p $1");