From 58e89bfad335c4e5fc6e1db6c87b850ca91c7d4a Mon Sep 17 00:00:00 2001 From: rillig Date: Wed, 14 Nov 2007 16:03:07 +0000 Subject: Properly check the return value of load_lines("PLIST.common"). --- pkgtools/pkglint/files/pkglint.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 4f004ffa1b8..18c9ed3fc6b 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.734 2007/11/07 17:01:24 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.735 2007/11/14 16:03:07 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -7361,7 +7361,14 @@ sub checkfile_PLIST($) { # Get the list of all files from the PLIST. my $all_files = {}; my $all_dirs = {}; - my $extra_lines = (basename($fname) eq "PLIST.common_end") ? load_file(dirname($fname) . "PLIST.common") : []; + my $extra_lines = []; + if (basename($fname) eq "PLIST.common_end") { + my $common_lines = load_file(dirname($fname) . "PLIST.common"); + if ($common_lines) { + $extra_lines = $common_lines; + } + } + foreach my $line (@{$extra_lines}, @{$lines}) { my $text = $line->text; -- cgit v1.2.3