summaryrefslogtreecommitdiff
path: root/bin/ksh/eval.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-12-22 18:39:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-12-22 18:39:32 +0000
commit789ed5943cc6349ea0276feedb68a6131a42455d (patch)
treee585e84e02bc1045b08ece18dfb7a6d854e5da34 /bin/ksh/eval.c
parent72a5dfdff27eff243becb3a647a0510b3228d41d (diff)
Make 'echo ${a[@]:?foo}' produce an error, not a core dump.
Bug noticed by otto@.
Diffstat (limited to 'bin/ksh/eval.c')
-rw-r--r--bin/ksh/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c
index 86a5422a669..64529a44bee 100644
--- a/bin/ksh/eval.c
+++ b/bin/ksh/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.22 2004/12/22 17:14:34 millert Exp $ */
+/* $OpenBSD: eval.c,v 1.23 2004/12/22 18:39:31 millert Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
@@ -766,6 +766,7 @@ varsub(Expand *xp, char *sp, char *word,
case '=': /* can't assign to a vector */
case '%': /* can't trim a vector (yet) */
case '#':
+ case '?':
return -1;
}
if (e->loc->argc == 0) {