diff options
author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-06-29 19:01:31 +0100 |
---|---|---|
committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-06-29 19:01:31 +0100 |
commit | 7708849b2186ce60e80e0dbc9ade89ad7404499e (patch) | |
tree | 2b5f1d4025e63fd5e8c339930811c564130c52ae /Src | |
parent | 7bc47c91e92cc6642e6dd416c4f94fb22bc6309c (diff) | |
download | zsh-7708849b2186ce60e80e0dbc9ade89ad7404499e.tar.gz zsh-7708849b2186ce60e80e0dbc9ade89ad7404499e.tar.xz zsh-7708849b2186ce60e80e0dbc9ade89ad7404499e.zip |
35655: APPEND_CREATE option for POSIX copmatible NO_CLOBBER
Diffstat (limited to 'Src')
-rw-r--r-- | Src/exec.c | 3 | ||||
-rw-r--r-- | Src/options.c | 1 | ||||
-rw-r--r-- | Src/zsh.h | 1 |
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, |