summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Subst.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Subst.pm b/usr.sbin/pkg_add/OpenBSD/Subst.pm
index bc772d96054..665defa5bee 100644
--- a/usr.sbin/pkg_add/OpenBSD/Subst.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Subst.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Subst.pm,v 1.2 2008/04/07 11:55:22 espie Exp $
+# $OpenBSD: Subst.pm,v 1.3 2008/04/07 12:02:59 espie Exp $
#
# Copyright (c) 2008 Marc Espie <espie@openbsd.org>
#
@@ -27,6 +27,11 @@ sub new
bless {}, shift;
}
+sub hash
+{
+ shift;
+}
+
sub add
{
my ($self, $k, $v) = @_;
@@ -57,7 +62,7 @@ sub do
my $self = shift;
local $_ = shift;
return $_ unless m/\$/o; # optimization
- while (my ($k, $v) = each %$self) {
+ while (my ($k, $v) = each %{$self->hash}) {
s/\$\{\Q$k\E\}/$v/g;
}
s/\$\\/\$/go;