summary refs log tree commit diff
path: root/src/expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expand.c')
-rw-r--r--src/expand.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/expand.c b/src/expand.c
index e3e5d8f..54fe908 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -749,6 +749,10 @@ evalvar(char *p, int flag)
 
 	varflags = *p++;
 	subtype = varflags & VSTYPE;
+
+	if (!subtype)
+		sh_error("Bad substitution");
+
 	quoted = flag & EXP_QUOTED;
 	var = p;
 	easy = (!quoted || (*var == '@' && shellparam.nparam));