From ad29258c8c2785796d3149c6c230e55d9debc82b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 1 Jul 2011 15:23:01 +0000 Subject: 29530: ${...?...} shouldn't cause an error with NO_EXEC option --- Src/subst.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'Src/subst.c') diff --git a/Src/subst.c b/Src/subst.c index e8a181129..1b0097001 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2715,19 +2715,21 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) case '?': case Quest: if (vunset) { - *idend = '\0'; - zerr("%s: %s", idbeg, *s ? s : "parameter not set"); - if (!interact) { - if (mypid == getpid()) { - /* - * paranoia: don't check for jobs, but there shouldn't - * be any if not interactive. - */ - stopmsg = 1; - zexit(1, 0); - } else - _exit(1); - } + if (isset(EXECOPT)) { + *idend = '\0'; + zerr("%s: %s", idbeg, *s ? s : "parameter not set"); + if (!interact) { + if (mypid == getpid()) { + /* + * paranoia: don't check for jobs, but there + * shouldn't be any if not interactive. + */ + stopmsg = 1; + zexit(1, 0); + } else + _exit(1); + } + } return NULL; } break; -- cgit 1.4.1