about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-04-26 10:40:56 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-04-26 10:40:56 -0700
commit5ee05cf9353b36e2dbe4149717ec239d074d1f21 (patch)
treebddae51e422b59dfb8e003b04fcea8cd5b1727ee /Src/exec.c
parent442d702bbc33adafe75ed4ca4ad8b0404eb52584 (diff)
downloadzsh-5ee05cf9353b36e2dbe4149717ec239d074d1f21.tar.gz
zsh-5ee05cf9353b36e2dbe4149717ec239d074d1f21.tar.xz
zsh-5ee05cf9353b36e2dbe4149717ec239d074d1f21.zip
38350 (cf. Glenn Smith: 38348): Remove-all warning should warn about the root directory as well
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 50eff72cb..2dcd5bcf5 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2902,11 +2902,11 @@ execcmd(Estate state, int input, int output, int how, int last1)
 	    if (s[0] == Star && !s[1]) {
 		if (!checkrmall(pwd))
 		    uremnode(args, node);
-	    } else if (l > 2 && s[l - 2] == '/' && s[l - 1] == Star) {
+	    } else if (l >= 2 && s[l - 2] == '/' && s[l - 1] == Star) {
 		char t = s[l - 2];
 
 		s[l - 2] = 0;
-		if (!checkrmall(s))
+		if (!checkrmall(*s ? s : "/"))
 		    uremnode(args, node);
 		s[l - 2] = t;
 	    }