summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/pkg-config/pkg-config11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/pkg-config/pkg-config b/usr.bin/pkg-config/pkg-config
index 42fa1b012a3..6dedc57e5f1 100644
--- a/usr.bin/pkg-config/pkg-config
+++ b/usr.bin/pkg-config/pkg-config
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $OpenBSD: pkg-config,v 1.19 2006/12/16 17:14:34 espie Exp $
+# $OpenBSD: pkg-config,v 1.20 2007/02/01 16:38:21 espie Exp $
#$CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $
# Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org>
@@ -423,6 +423,8 @@ sub do_libs
sub do_list
{
my ($p, $x, $y, @files, $fname, $name);
+ my $error = 0;
+
foreach my $p (@PKGPATH) {
push(@files, <$p/*.pc>);
}
@@ -439,12 +441,17 @@ sub do_list
foreach my $f (@files) {
my $cfg = get_config($f);
+ if (!defined $cfg) {
+ print STDERR "Problem reading file $f\n";
+ $error = 1;
+ next;
+ }
$fname = basename($f, '.pc');
printf("%${x}s %s - %s\n", $fname,
stringize($cfg->get_property('Name', $variables)),
stringize($cfg->get_property('Description', $variables)));
}
- return 0;
+ return $error;
}
sub help