busybox: fix handling of special characters in path when converting menuconfig
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 3 Jan 2016 11:36:38 +0000 (11:36 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 3 Jan 2016 11:36:38 +0000 (11:36 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48077 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/utils/busybox/convert_menuconfig.pl

index fd99349..7342fbd 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");