summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2023-10-23 21:53:55 +0000
committerMarc Espie <espie@cvs.openbsd.org>2023-10-23 21:53:55 +0000
commitd7d83ab799f1aff246458f25e691cba8b9662837 (patch)
tree0783af75353f4cff1640a6d25c146b8f0528fece /usr.sbin
parent9662a093c976992f2a11f5776b9333fab2af788d (diff)
sorry, somehow I did redo this line badly and didn't retest
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Subst.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Subst.pm b/usr.sbin/pkg_add/OpenBSD/Subst.pm
index 47c684da07a..d0cc116aa27 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.23 2023/10/23 19:45:28 tb Exp $
+# $OpenBSD: Subst.pm,v 1.24 2023/10/23 21:53:54 espie Exp $
#
# Copyright (c) 2008 Marc Espie <espie@openbsd.org>
#
@@ -46,11 +46,15 @@ sub value($self, $k)
sub parse_option($self, $opt)
{
- if ($opt =~ m/^([^=]+)\=(.*)$/o) {
- my ($k, $v) = ($1, $2);
+ if ($opt =~ m/^([^=+]+)(\+?)\=(.*)$/o) {
+ my ($k, $plus, $v) = ($1, $2, $3);
$v =~ s/^\'(.*)\'$/$1/;
$v =~ s/^\"(.*)\"$/$1/;
- $self->add($k, $v);
+ if ($plus && defined $self->{k}) {
+ $self->{$k} .= " $v";
+ } else {
+ $self->add($k, $v);
+ }
} else {
$self->add($opt, 1);
}