summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2015-06-29 19:01:31 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2015-06-29 19:01:31 +0100
commit7708849b2186ce60e80e0dbc9ade89ad7404499e (patch)
tree2b5f1d4025e63fd5e8c339930811c564130c52ae /Src/exec.c
parent7bc47c91e92cc6642e6dd416c4f94fb22bc6309c (diff)
downloadzsh-7708849b2186ce60e80e0dbc9ade89ad7404499e.tar.gz
zsh-7708849b2186ce60e80e0dbc9ade89ad7404499e.tar.xz
zsh-7708849b2186ce60e80e0dbc9ade89ad7404499e.zip
35655: APPEND_CREATE option for POSIX copmatible NO_CLOBBER
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 39d132647..960601f29 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3315,7 +3315,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 		    fil = -1;
 		else if (IS_APPEND_REDIR(fn->type))
 		    fil = open(unmeta(fn->name),
-			       (unset(CLOBBER) && !IS_CLOBBER_REDIR(fn->type)) ?
+			       ((unset(CLOBBER) && unset(APPENDCREATE)) &&
+				!IS_CLOBBER_REDIR(fn->type)) ?
 			       O_WRONLY | O_APPEND | O_NOCTTY :
 			       O_WRONLY | O_APPEND | O_CREAT | O_NOCTTY, 0666);
 		else