# 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>
#
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);
}