summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index c36a36af676..f4e99dc11a0 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.212 2013/05/13 18:30:51 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.213 2013/10/15 20:23:51 schwarze Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -589,6 +589,10 @@ sub format
my $base = $state->{base};
my $fname = $base.$self->fullname;
+ if (-z $fname) {
+ $state->error("empty source manpage: #1", $fname);
+ return;
+ }
open(my $fh, '<', $fname) or die "Can't read $fname";
my $line = <$fh>;
close $fh;
@@ -620,6 +624,7 @@ sub format
} else {
die "Can't parse source name $fname";
}
+ return 1;
}
package OpenBSD::PackingElement::Mandoc;