Tue Jul 30 18:46:29 2013 UTC ()
Make Bq and Er optional for errors.


(wiz)
diff -r1.34 -r1.35 pkgsrc/textproc/mdoclint/files/mdoclint

cvs diff -r1.34 -r1.35 pkgsrc/textproc/mdoclint/files/Attic/mdoclint (expand / switch to unified diff)

--- pkgsrc/textproc/mdoclint/files/Attic/mdoclint 2013/07/30 18:37:56 1.34
+++ pkgsrc/textproc/mdoclint/files/Attic/mdoclint 2013/07/30 18:46:29 1.35
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1#!@PERL5@ 1#!@PERL5@
2# 2#
3# $OpenBSD: mdoclint,v 1.14 2009/04/13 12:40:05 espie Exp $ 3# $OpenBSD: mdoclint,v 1.14 2009/04/13 12:40:05 espie Exp $
4# $NetBSD: mdoclint,v 1.34 2013/07/30 18:37:56 wiz Exp $ 4# $NetBSD: mdoclint,v 1.35 2013/07/30 18:46:29 wiz Exp $
5# 5#
6# Copyright (c) 2001-2013 Thomas Klausner 6# Copyright (c) 2001-2013 Thomas Klausner
7# All rights reserved. 7# All rights reserved.
8# 8#
9# Redistribution and use in source and binary forms, with or without 9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions 10# modification, are permitted provided that the following conditions
11# are met: 11# are met:
12# 1. Redistributions of source code must retain the above copyright 12# 1. Redistributions of source code must retain the above copyright
13# notice, this list of conditions and the following disclaimer. 13# notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright 14# 2. Redistributions in binary form must reproduce the above copyright
15# notice, this list of conditions and the following disclaimer in the 15# notice, this list of conditions and the following disclaimer in the
16# documentation and/or other materials provided with the distribution. 16# documentation and/or other materials provided with the distribution.
17# 17#
@@ -627,28 +627,28 @@ sub process_line @@ -627,28 +627,28 @@ sub process_line
627 if (/^\.Pp/o and $s->{lastline} =~ /^(\.S[Ssh])/o) { 627 if (/^\.Pp/o and $s->{lastline} =~ /^(\.S[Ssh])/o) {
628 $s->warning("Paragraph problem: .Pp after $1") if $opt_P; 628 $s->warning("Paragraph problem: .Pp after $1") if $opt_P;
629 } 629 }
630 630
631 # Check whether the list of possible errors for a function is 631 # Check whether the list of possible errors for a function is
632 # sorted alphabetically. 632 # sorted alphabetically.
633 # 633 #
634 # Error names should not be sorted across different lists. 634 # Error names should not be sorted across different lists.
635 # (see bind(2) for an example.) 635 # (see bind(2) for an example.)
636 # 636 #
637 /^\.Bl\s+/o and $s->{last_error_name} = ""; 637 /^\.Bl\s+/o and $s->{last_error_name} = "";
638 638
639 if ($s->{current_section_header} eq "ERRORS" and 639 if ($s->{current_section_header} eq "ERRORS" and
640 /^\.It\s+Bq\s+Er\s+(E[\w_]+)$/o) { 640 /^\.It\s+(Bq\s+)?(Er\s+)?(E[\w_]+)$/o) {
641 my $current_error_name = $1; 641 my $current_error_name = $3;
642 642
643 if ($s->{last_error_name} eq $current_error_name) { 643 if ($s->{last_error_name} eq $current_error_name) {
644 $s->warning("Duplicate item for ", 644 $s->warning("Duplicate item for ",
645 $current_error_name, ".") if $opt_e; 645 $current_error_name, ".") if $opt_e;
646 } elsif ($current_error_name lt $s->{last_error_name}) { 646 } elsif ($current_error_name lt $s->{last_error_name}) {
647 $s->warning("$s->{last_error_name} and ", 647 $s->warning("$s->{last_error_name} and ",
648 "$current_error_name are not in ", 648 "$current_error_name are not in ",
649 "alphabetical order.") if $opt_e; 649 "alphabetical order.") if $opt_e;
650 } 650 }
651 $s->{last_error_name} = $current_error_name; 651 $s->{last_error_name} = $current_error_name;
652 } 652 }
653 653
654 $s->{lastline} = $_; 654 $s->{lastline} = $_;