summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Src/subst.c28
-rw-r--r--Test/E01options.ztst4
3 files changed, 25 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index e4016aa3a..c2f1fd8a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-01 Peter Stephenson <pws@csr.com>
+
+ * 29530: Src/subst.c, Test/E01options.ztst: ${..?..} shouldn't
+ cause an error with NO_EXEC option.
+
2011-07-01 Frank Terbeck <ft@bewatermyfriend.org>
* 29518: Completion/Unix/Command/_git: Fall back to file
@@ -15077,5 +15082,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5389 $
+* $Revision: 1.5390 $
*****************************************************
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;
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 4b53840c6..1bbfdbda1 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -353,6 +353,10 @@
echo *NonExistentFile*)
0:NO_EXEC option should not do globbing
+ (setopt noexec
+ echo ${unset_var?Not an error})
+0:NO_EXEC should not test for unset variables
+
setopt NO_eval_lineno
eval 'print $LINENO'
setopt eval_lineno