summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
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,