From 702c5916284f860dae7c6746e16a1e82ac3d2660 Mon Sep 17 00:00:00 2001 From: espie Date: Sat, 18 Jan 2014 01:02:25 +0000 Subject: [PATCH] caching a bit more tricky... problem noticed by naddy@ --- usr.sbin/pkg_add/OpenBSD/PackageLocation.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } -- 2.20.1