summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c3
-rw-r--r--Src/options.c1
-rw-r--r--Src/zsh.h1
3 files changed, 4 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
diff --git a/Src/options.c b/Src/options.c
index da3d8308a..1fb102f1d 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -81,6 +81,7 @@ static struct optname optns[] = {
{{NULL, "allexport", OPT_EMULATE}, ALLEXPORT},
{{NULL, "alwayslastprompt", OPT_ALL}, ALWAYSLASTPROMPT},
{{NULL, "alwaystoend", 0}, ALWAYSTOEND},
+{{NULL, "appendcreate", OPT_EMULATE|OPT_BOURNE}, APPENDCREATE},
{{NULL, "appendhistory", OPT_ALL}, APPENDHISTORY},
{{NULL, "autocd", OPT_EMULATE}, AUTOCD},
{{NULL, "autocontinue", 0}, AUTOCONTINUE},
diff --git a/Src/zsh.h b/Src/zsh.h
index ce9b97903..183620f93 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -2120,6 +2120,7 @@ enum {
CHASELINKS,
CHECKJOBS,
CLOBBER,
+ APPENDCREATE,
COMBININGCHARS,
COMPLETEALIASES,
COMPLETEINWORD,