summaryrefslogtreecommitdiff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2013-11-07 14:52:31 +0100
committerAxel Beckert <abe@deuxchevaux.org>2013-11-07 14:52:31 +0100
commitd799ac78a744a5359563af55b4dee9e91255a1dc (patch)
tree73475ed7089e6ee050085a96b88018994b43bdfc /Src/subst.c
parentabfb3b136a4ad5b2832fb7d920442a2bb28c0697 (diff)
parent375115c7dfd6dff576915d25fe2ecdd381dd9d81 (diff)
downloadzsh-d799ac78a744a5359563af55b4dee9e91255a1dc.tar.gz
zsh-d799ac78a744a5359563af55b4dee9e91255a1dc.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 974a8456d..a4df2567f 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3707,6 +3707,11 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
char *y;
x = val;
+ if (!x) {
+ /* Shouldn't have got here with a NULL string. */
+ DPUTS(1, "value is NULL in paramsubst");
+ return NULL;
+ }
if (prenum || postnum)
x = dopadding(x, prenum, postnum, preone, postone,
premul, postmul
@@ -4021,7 +4026,10 @@ modify(char **str, char **ptr)
all = tmp;
t = e;
}
- *str = all;
+ if (!all)
+ *str = dupstring("");
+ else
+ *str = all;
} else {
switch (c) {