From f1cbb2a734f46279ad3fa942978d29d9cf25978c Mon Sep 17 00:00:00 2001 From: herbert Date: Wed, 18 Aug 2004 21:24:11 +1000 Subject: Fixed expansion when leading argument is null in src/expand.c. --- src/expand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/expand.c') diff --git a/src/expand.c b/src/expand.c index 800011e..b2800c6 100644 --- a/src/expand.c +++ b/src/expand.c @@ -976,9 +976,12 @@ param: size_t partlen; partlen = strlen(p); - len += partlen; - if (len > partlen && sep) { + + if (!(subtype == VSPLUS || subtype == VSLENGTH)) + memtodest(p, partlen, syntax, quotes); + + if (*ap && sep) { char *q; len++; @@ -991,9 +994,6 @@ param: STPUTC(sep, q); expdest = q; } - - if (!(subtype == VSPLUS || subtype == VSLENGTH)) - memtodest(p, partlen, syntax, quotes); } return len; case '0': -- cgit 1.4.1