summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2019-12-26 03:54:17 +0100
committerMikael Magnusson <mikachu@gmail.com>2020-04-02 07:42:16 +0200
commit8923d2a61824b0856839d52f3bf52aedb86fd827 (patch)
tree7c600a7c3531df51c1e010b5cb2a5c8cfec6fc5c /Src
parentc57d660764c368d6c1e0104f2b781c85e5a33f0b (diff)
downloadzsh-8923d2a61824b0856839d52f3bf52aedb86fd827.tar.gz
zsh-8923d2a61824b0856839d52f3bf52aedb86fd827.zip
Add SHORT_REPEAT option
Diffstat (limited to 'Src')
-rw-r--r--Src/lex.c2
-rw-r--r--Src/options.c1
-rw-r--r--Src/parse.c2
-rw-r--r--Src/zsh.h1
4 files changed, 4 insertions, 2 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 1d86da94e..a541defe6 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -270,7 +270,7 @@ zshlex(void)
do {
if (inrepeat_)
++inrepeat_;
- if (inrepeat_ == 3 && isset(SHORTLOOPS))
+ if (inrepeat_ == 3 && (isset(SHORTLOOPS) || isset(SHORTREPEAT)))
incmdpos = 1;
tok = gettok();
} while (tok != ENDINPUT && exalias());
diff --git a/Src/options.c b/Src/options.c
index 08ba71917..7586d21d2 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -248,6 +248,7 @@ static struct optname optns[] = {
{{NULL, "shnullcmd", OPT_EMULATE|OPT_BOURNE}, SHNULLCMD},
{{NULL, "shoptionletters", OPT_EMULATE|OPT_BOURNE}, SHOPTIONLETTERS},
{{NULL, "shortloops", OPT_EMULATE|OPT_NONBOURNE},SHORTLOOPS},
+{{NULL, "shortrepeat", OPT_EMULATE}, SHORTREPEAT},
{{NULL, "shwordsplit", OPT_EMULATE|OPT_BOURNE}, SHWORDSPLIT},
{{NULL, "singlecommand", OPT_SPECIAL}, SINGLECOMMAND},
{{NULL, "singlelinezle", OPT_KSH}, SINGLELINEZLE},
diff --git a/Src/parse.c b/Src/parse.c
index 08919b2da..10c9b4c29 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1593,7 +1593,7 @@ par_repeat(int *cmplx)
if (tok != ZEND)
YYERRORV(oecused);
zshlex();
- } else if (unset(SHORTLOOPS)) {
+ } else if (unset(SHORTLOOPS) && unset(SHORTREPEAT)) {
YYERRORV(oecused);
} else
par_save_list1(cmplx);
diff --git a/Src/zsh.h b/Src/zsh.h
index d72c338da..1f2d774a1 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -2508,6 +2508,7 @@ enum {
SHNULLCMD,
SHOPTIONLETTERS,
SHORTLOOPS,
+ SHORTREPEAT,
SHWORDSPLIT,
SINGLECOMMAND,
SINGLELINEZLE,