Package: curl / 7.64.0-2

12_zsh.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Description: Fixes for ZSH completion generator
Origin: vendor
Bug-Debian: http://bugs.debian.org/921452
Forwarded: https://github.com/curl/curl/pull/3528
Author: Alessandro Ghedini <ghedo@debian.org>
Last-Update: 2018-02-06

diff --git a/scripts/zsh.pl b/scripts/zsh.pl
index 1257190df..0f9cbec7d 100755
--- a/scripts/zsh.pl
+++ b/scripts/zsh.pl
@@ -7,7 +7,7 @@ use warnings;
 
 my $curl = $ARGV[0] || 'curl';
 
-my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s([^\s.]+)?\s+(.*)';
+my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s*(\<.+?\>)?\s+(.*)';
 my @opts = parse_main_opts('--help', $regex);
 
 my $opts_str;
@@ -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;