[pve-devel] [PATCH pve-common] fix regex quoting in $print_bash_completion

Dietmar Maurer dietmar at proxmox.com
Thu Jun 14 09:04:47 CEST 2018


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 src/PVE/CLIHandler.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
index d871ba6..0d2604e 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -313,7 +313,7 @@ my $print_bash_completion = sub {
     shift @$args; # no need for program name
     my $print_result = sub {
 	foreach my $p (@_) {
-	    print "$p\n" if $p =~ m/^$cur/;
+	    print "$p\n" if $p =~ m/^\Q$cur\E/;
 	}
     };
 
-- 
2.11.0



More information about the pve-devel mailing list