about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-07-01 15:23:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-07-01 15:23:01 +0000
commitad29258c8c2785796d3149c6c230e55d9debc82b (patch)
tree83b8c7e4028779c51b09f57899dc4c83807305b2 /Src/subst.c
parent47347fc7d7decb08155abbeebdbeed4fc7ace6d9 (diff)
downloadzsh-ad29258c8c2785796d3149c6c230e55d9debc82b.tar.gz
zsh-ad29258c8c2785796d3149c6c230e55d9debc82b.tar.xz
zsh-ad29258c8c2785796d3149c6c230e55d9debc82b.zip
29530: ${...?...} shouldn't cause an error with NO_EXEC option
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c28
1 files changed, 15 insertions, 13 deletions
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;