From b3cc8017b7364f588365be2b2629c49c142efdb7 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Tue, 5 Feb 2019 21:06:26 +0000 Subject: [PATCH] zsh.pl: escape ':' character ':' is interpreted as separator by zsh, so if used as part of the argument or option's description it needs to be escaped. The problem can be reproduced as follows: % curl --reso % curl -E Bug: https://bugs.debian.org/921452 --- scripts/zsh.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/zsh.pl b/scripts/zsh.pl index 941b3222c..0f9cbec7d 100755 --- a/scripts/zsh.pl +++ b/scripts/zsh.pl @@ -45,9 +45,12 @@ sub parse_main_opts { my $option = ''; + $arg =~ s/\:/\\\:/g if defined $arg; + $desc =~ s/'/'\\''/g if defined $desc; $desc =~ s/\[/\\\[/g if defined $desc; $desc =~ s/\]/\\\]/g if defined $desc; + $desc =~ s/\:/\\\:/g if defined $desc; $option .= '{' . trim($short) . ',' if defined $short; $option .= trim($long) if defined $long;