diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | Src/Zle/compcore.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index dda1c6b22..3f7e95417 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-05-25 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 42809: Src/Zle/compcore.c: slightly improve 'compset -q' + 2018-05-19 Oliver Kiddle <okiddle@yahoo.co.uk> * 42806: Completion/Unix/Command/_shutdown: fix where options diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index c3b971e0d..f733e0ee5 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -1638,7 +1638,7 @@ set_comp_sep(void) p[-1] = '\0'; } } - if (tok == ENDINPUT || tok == LEXERR) + if (tok == ENDINPUT) break; if (tokstr && *tokstr) { for (p = tokstr; dq && *p; p++) { @@ -1667,7 +1667,7 @@ set_comp_sep(void) if (!got && !lexflags) { DPUTS(!p, "no current word in substr"); got = 1; - cur = i; + cur = countlinknodes(foo) - 1; /* cur is 0 offset */ swb = wb - 1 - dq - sq - dolq; swe = we - 1 - dq - sq - dolq; sqq = lsq; @@ -1902,7 +1902,10 @@ set_comp_sep(void) untokenize(p); } /* The current position shouldn't exceed the new word count */ - compcurrent = cur + 1 > i ? i : cur + 1; + if ((compcurrent = cur + 1) > i) { + DPUTS2(1, "compcurrent=%d > number_of_words=%d", compcurrent, i); + compcurrent = i; + } compwords[i] = NULL; } instring = ois; |