diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/Zle/computil.c | 2 | ||||
-rw-r--r-- | Test/Y03arguments.ztst | 8 |
3 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 4ce3987a2..f27845225 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-11-04 Oliver Kiddle <opk@zsh.org> + + * 41983: Src/Zle/computil.c, Test/Y03arguments.ztst: + fix exclusion of long options with (-) on a normal argument + 2017-11-03 Daniel Shahaf <d.s@daniel.shahaf.name> * 41969: Completion/Unix/Command/_sort: Clarify option diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 70cea9f27..71d61563b 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -2080,7 +2080,7 @@ ca_parse_line(Cadef d, Cadef all, int multi, int first) remnulargs(line); untokenize(line); - ca_inactive(d, argxor, cur, 0); + ca_inactive(d, argxor, cur - 1, 0); if ((d->flags & CDF_SEP) && cur != compcurrent && !strcmp(line, "--")) { ca_inactive(d, NULL, cur, 1); continue; diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst index de495ee6c..7cbadfe8c 100644 --- a/Test/Y03arguments.ztst +++ b/Test/Y03arguments.ztst @@ -485,12 +485,18 @@ >NO:{-c} >NO:{-g} - tst_arguments '(-)-h' -a -b -c + tst_arguments '(-)-h' -a -b -c --long +p comptest $'tst -h -\t' 0:exclude all other options >line: {tst -h -}{} >MESSAGE:{no arguments} + tst_arguments --args -b -c +p '(-)1:normal' + comptest $'tst arg -\t' +0:exclude all options from a normal argument +>line: {tst arg -}{} +>MESSAGE:{no more arguments} + tst_arguments -a '(-a)-b' comptest $'tst - -b\C-b\C-b\C-b\t' 0:exclusion only applies to later words |