Hola,

This was spotted by mischief on #openbsd (freenode). Currently if -v
is used with -Q and PKG_PATH is not set, users see:

  Use of uninitialized value $ENV{"PKG_PATH"} in concatenation (.) or
  string at /usr/libdata/perl5/OpenBSD/PkgInfo.pm line...

This diff fixes that.

OK?

Cheers,
Aaron

Index: OpenBSD/PkgInfo.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PkgInfo.pm,v
retrieving revision 1.46
diff -u -p -r1.46 PkgInfo.pm
--- OpenBSD/PkgInfo.pm  4 Aug 2017 23:35:40 -0000       1.46
+++ OpenBSD/PkgInfo.pm  6 Aug 2017 03:31:38 -0000
@@ -596,7 +596,8 @@ sub parse_and_run
        if ($state->opt('Q')) {
                require OpenBSD::Search;
 
-               print "PKG_PATH=$ENV{PKG_PATH}\n" if $state->verbose;
+               print "PKG_PATH=$ENV{PKG_PATH}\n" if ($state->verbose &&
+                   defined $ENV{PKG_PATH});
                my $partial = 
OpenBSD::Search::PartialStem->new($state->opt('Q'));
                my $r = $state->repo->match_locations($partial);
 


-- 
PGP: 0x1F81112D62A9ADCE / 3586 3350 BFEA C101 DB1A  4AF0 1F81 112D 62A9 ADCE

Reply via email to