diff options
author | 2014-03-21 10:58:46 +0000 | |
---|---|---|
committer | 2014-03-21 10:58:46 +0000 | |
commit | 955a0a0519b5dfc4b1ac3fb1eda23ea59dee77e0 (patch) | |
tree | daab2d4b01f083338475f1144ac4001358842124 | |
parent | rt_timer* spring cleanup. (diff) | |
download | wireguard-openbsd-955a0a0519b5dfc4b1ac3fb1eda23ea59dee77e0.tar.xz wireguard-openbsd-955a0a0519b5dfc4b1ac3fb1eda23ea59dee77e0.zip |
fix picky mode, my subject handler was not maintaining enough state.
problem introduced some time ago while improving the code :(
okay millert@
-rw-r--r-- | libexec/makewhatis/OpenBSD/Makewhatis.pm | 14 | ||||
-rw-r--r-- | libexec/makewhatis/OpenBSD/Makewhatis/Subject.pm | 14 |
2 files changed, 17 insertions, 11 deletions
diff --git a/libexec/makewhatis/OpenBSD/Makewhatis.pm b/libexec/makewhatis/OpenBSD/Makewhatis.pm index 5099d5fa0b2..2fd026b9c7b 100644 --- a/libexec/makewhatis/OpenBSD/Makewhatis.pm +++ b/libexec/makewhatis/OpenBSD/Makewhatis.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Makewhatis.pm,v 1.12 2013/01/29 11:08:55 espie Exp $ +# $OpenBSD: Makewhatis.pm,v 1.13 2014/03/21 10:58:46 espie Exp $ # Copyright (c) 2000-2004 Marc Espie <espie@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any @@ -137,13 +137,13 @@ sub scan_manpages $p->errsay("Can't find type of #1", $_); next; } - if ($p->picky) { - require OpenBSD::Makewhatis::Check; + } + if ($p->picky) { + require OpenBSD::Makewhatis::Check; - for my $s ($h->subjects) { - OpenBSD::Makewhatis::Check::verify_subject($s, - $_, $p); - } + while (my ($s, $f) = each %{$h->subject_hash}) { + OpenBSD::Makewhatis::Check::verify_subject($s, + $f, $p); } } my @done = $h->subjects; diff --git a/libexec/makewhatis/OpenBSD/Makewhatis/Subject.pm b/libexec/makewhatis/OpenBSD/Makewhatis/Subject.pm index 37e1394360e..1bca546f073 100644 --- a/libexec/makewhatis/OpenBSD/Makewhatis/Subject.pm +++ b/libexec/makewhatis/OpenBSD/Makewhatis/Subject.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Subject.pm,v 1.3 2013/01/29 11:08:56 espie Exp $ +# $OpenBSD: Subject.pm,v 1.4 2014/03/21 10:58:46 espie Exp $ # Copyright (c) 2010 Marc Espie <espie@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any @@ -22,13 +22,13 @@ package OpenBSD::Makewhatis::SubjectHandler; sub new { my ($class, $p) = @_; - return bless { p => $p, subjects => []}, $class; + return bless { p => $p, subjects => {}}, $class; } sub add { my ($h, $s) = @_; - push(@{$h->{subjects}}, $s); + $h->{subjects}{$s} = $h->{current}; $h->{has_subjects} = 1; } @@ -41,7 +41,13 @@ sub no_subjects sub subjects { my $h = shift; - return @{$h->{subjects}}; + return keys %{$h->{subjects}}; +} + +sub subject_hash +{ + my $h = shift; + return $h->{subjects}; } sub p |