summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-03-12 08:44:06 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-03-12 08:44:06 +0100
commit92696ab6bd2c64c614866c4c1c3df68130ae90a3 (patch)
tree8054e074029a65809594d274f8f462ff885cc347
parentfe40c264c0c440aaf37d78ba72b0fc00120d2ef0 (diff)
downloadcurl-bagder/nroff-quote-minuses.tar.gz
fixup manpage-scan.pl to work with more quotesbagder/nroff-quote-minuses
-rwxr-xr-xtests/manpage-scan.pl18
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.-]*)/) {