summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2017-12-06 22:49:19 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2017-12-20 04:13:01 +0000
commita9e60dc1794dadaae6d73a1de3f5cf8418336771 (patch)
treef48d4c887bcd29085b7b38d82220d0aabfd5a825
parent972cf4197ef21aa1caa7a3fe721d5b2e8930da0d (diff)
downloadzsh-a9e60dc1794dadaae6d73a1de3f5cf8418336771.tar.gz
zsh-a9e60dc1794dadaae6d73a1de3f5cf8418336771.zip
users/13148 (and workers/42060): Abort the command line when replying
"[n] No" to the RM_STAR_SILENT prompt. Patch by Stephane, rebased by Mikael.
-rw-r--r--ChangeLog6
-rw-r--r--Src/exec.c17
2 files changed, 17 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 30058dce3..f11321438 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-20 Daniel Shahaf <d.s@daniel.shahaf.name>
+
+ * Stephane (rebased by Mikael): users/13148, workers/42060:
+ Src/exec.c: Abort the command line when replying "[n] No" to
+ the RM_STAR_SILENT prompt.
+
2017-12-20 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 42143: Completion/Unix/Type/_object_files: fix a pattern for
diff --git a/Src/exec.c b/Src/exec.c
index 664d79079..3678ef84a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3251,19 +3251,24 @@ execcmd_exec(Estate state, Execcmd_params eparams,
next = nextnode(node);
if (s[0] == Star && !s[1]) {
- if (!checkrmall(pwd))
- uremnode(args, node);
+ if (!checkrmall(pwd)) {
+ errflag |= ERRFLAG_ERROR;
+ break;
+ }
} else if (l >= 2 && s[l - 2] == '/' && s[l - 1] == Star) {
char t = s[l - 2];
+ int rmall;
s[l - 2] = 0;
- if (!checkrmall(*s ? s : "/"))
- uremnode(args, node);
+ rmall = checkrmall(s);
s[l - 2] = t;
+
+ if (!rmall) {
+ errflag |= ERRFLAG_ERROR;
+ break;
+ }
}
}
- if (!nextnode(firstnode(args)))
- errflag |= ERRFLAG_ERROR;
}
if (type == WC_FUNCDEF) {