From 4a0ddedf0af0bbd22530132df830b588b2b63220 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 8 Feb 2010 11:49:28 +0000 Subject: unposted: a couple of typeset -g's and a comment --- Src/subst.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Src/subst.c') diff --git a/Src/subst.c b/Src/subst.c index 0bb0b798f..462d0b3a0 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2356,6 +2356,11 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) if (!(flags & (SUB_MATCH|SUB_REST|SUB_BIND|SUB_EIND|SUB_LEN))) flags |= SUB_REST; + /* + * With ":" treat a value as unset if the variable is set but + * - (array) contains no elements + * - (scalar) contains an empty string + */ if (colf && !vunset) vunset = (isarr) ? !*aval : !*val || (*val == Nularg && !val[1]); -- cgit 1.4.1