From 803fa9872f49f35cecd44ee7b60b150eb9e22327 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 16 Feb 2006 19:51:48 +0000 Subject: Made ${(A)=name:=word} (which is an array assignment) not split on quoted whitespace, just like the new ${1+"$@"} handling. --- Src/subst.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Src/subst.c b/Src/subst.c index 0b04d19ed..e6e6cba5b 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2070,27 +2070,23 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) case '=': case Equals: if (vunset) { + int ws = opts[SHWORDSPLIT]; char sav = *idend; int l; *idend = '\0'; val = dupstring(s); - /* - * TODO: this is one of those places where I don't - * think we want to do the joining until later on. - * We also need to handle spbreak and spsep at this - * point and unset them. - */ - if (spsep || spbreak || !arrasg) + if (spsep || !arrasg) { + opts[SHWORDSPLIT] = 0; multsub(&val, 0, NULL, &isarr, NULL); - else - multsub(&val, 0, &aval, &isarr, NULL); + } else { + opts[SHWORDSPLIT] = spbreak; + multsub(&val, spbreak, &aval, &isarr, NULL); + spbreak = 0; + } + opts[SHWORDSPLIT] = ws; if (arrasg) { - /* - * This is an array assignment in a context - * where we have no syntactic way of finding - * out what an array element is. So we just guess. - */ + /* This is an array assignment. */ char *arr[2], **t, **a, **p; if (spsep || spbreak) { aval = sepsplit(val, spsep, 0, 1); -- cgit 1.4.1