From: espie Date: Sat, 18 Jan 2014 01:02:25 +0000 (+0000) Subject: caching a bit more tricky... problem noticed by naddy@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=702c5916284f860dae7c6746e16a1e82ac3d2660;p=openbsd caching a bit more tricky... problem noticed by naddy@ --- diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm index b53b4021b2d..8d62c862f70 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageLocation.pm,v 1.31 2014/01/17 13:15:43 espie Exp $ +# $OpenBSD: PackageLocation.pm,v 1.32 2014/01/18 01:02:25 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -286,7 +286,11 @@ sub _next } if (!$self->{_unput}) { $self->{_current} = $self->getNext; - $self->{_current_name} = $self->{_current}{name}; + if (defined $self->{_current}) { + $self->{_current_name} = $self->{_current}{name}; + } else { + delete $self->{_current_name}; + } } else { $self->{_unput} = 0; }