]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmdline-opts/gen.pl: fix option matching to improve references
authorDaniel Stenberg <daniel@haxx.se>
Wed, 19 Jan 2022 10:38:50 +0000 (11:38 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 19 Jan 2022 12:29:28 +0000 (13:29 +0100)
Previously it could mistakenly match partial names when there are
options that start with the same prefix, leading to the wrong references
used.

Closes #8299

docs/cmdline-opts/gen.pl

index a7d013ae8bf976e1ba8fa266413a067d0995240b..296096a04ae2727c7033c071f62730d5eb0a99b7 100755 (executable)
@@ -104,7 +104,7 @@ sub printdesc {
         if($d =~ /^[^ ]/) {
             for my $k (keys %optlong) {
                 my $l = manpageify($k);
-                $d =~ s/--$k([^a-z0-9_-])/$l$1/;
+                $d =~ s/--$k([^a-z0-9_-])(\W)/$l$1$2/;
             }
         }
         # quote "bare" minuses in the output