summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/subst.c16
-rw-r--r--Test/D04parameter.ztst13
3 files changed, 31 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8df763425..34f5494e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2026-06-10 Mikael Magnusson <mikachu@gmail.com>
+
+ * 54674: Src/subst.c, Test/D04parameter.ztst: ::= didn't respect
+ parameter flags
+
2026-06-08 dana <dana@dana.is>
* unposted: NEWS: document COLUMNS+LINES change from w/54676
diff --git a/Src/subst.c b/Src/subst.c
index 16a3cb055..f72a6baf2 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3300,13 +3300,23 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
Param pm = sethparam(idbeg, a);
if (pm)
aval = paramvalarr(pm->gsu.h->getfn(pm), hkeys|hvals);
- } else
- setaparam(idbeg, a);
+ } else {
+ Param pm = setaparam(idbeg, a);
+ if (pm)
+ aval = pm->gsu.a->getfn(pm);
+ }
isarr = 1;
arrasg = 0;
} else {
untokenize(val);
- setsparam(idbeg, ztrdup(val));
+ Param pm = setsparam(idbeg, ztrdup(val));
+ if (pm) {
+ struct value vbuf = { 0 };
+ vbuf.pm = pm;
+ vbuf.end = -1;
+ vbuf.valflags = VALFLAG_SUBST;
+ val = getstrvalue(&vbuf);
+ }
}
*idend = sav;
copied = 1;
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 68c4ec288..57de28c72 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -82,6 +82,19 @@
>wasnull2d
>wasnull2d
+ typeset -Z3 zerothree
+ print ${zerothree::=15}
+ typeset -E3 ethree
+ five=5
+ print ${ethree::=five}
+ typeset -a -U uniquearr
+ typeset -a duplicates=(1 2 1 1 2 3)
+ print ${(A)uniquearr::=$duplicates}
+0:::= respects expansion flags
+>015
+>5.00e+00
+>1 2 3
+
unset array
print ${#${(A)=array=word}}
0:${#${(A)=array=word}} counts array elements