about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/subst.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/subst.c b/Src/subst.c
index cace51e8c..5f65945a5 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2649,8 +2649,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 		}
 		getmatcharr(&aval, s, flags, flnum, replstr);
 	    } else {
-		if (vunset)
+		if (vunset) {
+		    if (unset(UNSET)) {
+			*idend = '\0';
+			zerr("%s: parameter not set", idbeg);
+			return NULL;
+		    }
 		    val = dupstring("");
+		}
 		if (!copied) {
 		    val = dupstring(val);
 		    copied = 1;