diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-03-11 08:50:11 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-03-14 23:44:43 +0100 |
commit | f83d4ea56e91a21f9257570c2a6f5be9a55591b2 (patch) | |
tree | f64ca9f7df992587bc4bed07c8e177207182ed1f /tests/manpage-scan.pl | |
parent | 419f0f55348bd45e8a99cd26fc102b1913e15d87 (diff) | |
download | curl-f83d4ea56e91a21f9257570c2a6f5be9a55591b2.tar.gz |
gen.pl: quote "bare" minuses in the nroff curl.1
Reported-by: Alejandro Colomar
Fixes #6698
Closes #6722
Diffstat (limited to 'tests/manpage-scan.pl')
-rwxr-xr-x | tests/manpage-scan.pl | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/manpage-scan.pl b/tests/manpage-scan.pl index 78ceddd7e..ec2e7253d 100755 --- a/tests/manpage-scan.pl +++ b/tests/manpage-scan.pl @@ -6,7 +6,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 2016 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. +# Copyright (C) 2016 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -66,12 +66,19 @@ sub scanmanpage { my ($file, @words) = @_; open(M, "<$file"); - my @m = <M>; + my @m; + while(<M>) { + if($_ =~ /^\.IP (.*)/) { + my $w = $1; + # "unquote" minuses + $w =~ s/\\-/-/g; + push @m, $w; + } + } close(M); foreach my $m (@words) { - - my @g = grep(/^\.IP $m/, @m); + my @g = grep(/$m/, @m); if(!$g[0]) { print STDERR "Missing mention of $m in $file\n"; $errors++; @@ -206,7 +213,8 @@ my @manpage; # store all parsed parameters while(<R>) { chomp; my $l= $_; - if(/^\.IP \"(-[^\"]*)\"/) { + $l =~ s/\\-/-/g; + if($l =~ /^\.IP \"(-[^\"]*)\"/) { my $str = $1; my $combo; if($str =~ /^-(.), --([a-z0-9.-]*)/) { |