diff options
author | espie <espie@openbsd.org> | 2019-10-13 16:22:30 +0000 |
---|---|---|
committer | espie <espie@openbsd.org> | 2019-10-13 16:22:30 +0000 |
commit | 9d478369ce9ea3031d4ea8f0a6761be6faa055d3 (patch) | |
tree | f6dabc538d838040a743db0a5d2a6e9031cedcff /usr.sbin/pkg_add | |
parent | - have a method explicitly return undef instead of falling off the end (diff) | |
download | wireguard-openbsd-9d478369ce9ea3031d4ea8f0a6761be6faa055d3.tar.xz wireguard-openbsd-9d478369ce9ea3031d4ea8f0a6761be6faa055d3.zip |
even in the empty case, use wantarray to properly return 0/an empty array.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgSpec.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm index a21cca4a74b..eb85b41a561 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PkgSpec.pm,v 1.45 2014/03/07 09:45:53 espie Exp $ +# $OpenBSD: PkgSpec.pm,v 1.46 2019/10/13 16:22:30 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -289,7 +289,11 @@ LOOP1: } } - return @result; + if (wantarray) { + return @result; + } else { + return 0; + } } sub match_libs_ref |