From 6371325fdf6ca71e5f9839d65267f1d7c9a8863d Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 12 Sep 2006 09:56:25 +0000 Subject: 22689: untokenize strings used in parameter substitution pattern matching --- Src/subst.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/subst.c b/Src/subst.c index 1e8907d5c..3a2c3e111 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2257,15 +2257,28 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) /* * Either loop over an array doing replacements or * do the replacment on a string. + * + * We need an untokenized value for matching. */ if (!vunset && isarr) { + char **ap; + if (!copied) { + aval = arrdup(aval); + copied = 1; + } + for (ap = aval; *ap; ap++) { + untokenize(*ap); + } getmatcharr(&aval, s, flags, flnum, replstr); - copied = 1; } else { if (vunset) val = dupstring(""); + if (!copied) { + val = dupstring(val); + copied = 1; + untokenize(val); + } getmatch(&val, s, flags, flnum, replstr); - copied = 1; } break; } -- cgit 1.4.1