From: Daniel Stenberg Date: Wed, 19 Jan 2022 10:38:50 +0000 (+0100) Subject: cmdline-opts/gen.pl: fix option matching to improve references X-Git-Tag: curl-7_82_0~197 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fde0925214c41300b50c8136d35031615ecaa6bb;p=thirdparty%2Fcurl.git cmdline-opts/gen.pl: fix option matching to improve references 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 --- diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl index a7d013ae8b..296096a04a 100755 --- a/docs/cmdline-opts/gen.pl +++ b/docs/cmdline-opts/gen.pl @@ -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