diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2019-02-05 21:06:26 +0000 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2019-02-07 21:51:53 +0000 |
commit | b3cc8017b7364f588365be2b2629c49c142efdb7 (patch) | |
tree | 9d3a47d5db923db7b236ac443d854578e50c458b /scripts | |
parent | dbd32f3241b297b96ee11a51da1a661f528ca026 (diff) | |
download | curl-b3cc8017b7364f588365be2b2629c49c142efdb7.tar.gz |
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<TAB>
% curl -E <TAB>
Bug: https://bugs.debian.org/921452
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/zsh.pl | 3 |
1 files changed, 3 insertions, 0 deletions
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; |