diff options
author | dana <dana@dana.is> | 2017-12-28 01:47:57 -0600 |
---|---|---|
committer | Peter Stephenson <p.stephenson@samsung.com> | 2018-05-11 09:33:05 +0100 |
commit | eeeba19c965f29f9be1d1181222f2d3ef428da2b (patch) | |
tree | 500075dac33c2201545e9b2be33d2841fbf803e3 /Src/Zle | |
parent | 805192311f3426b852026b03e8ca4b421189fcf1 (diff) | |
download | zsh-eeeba19c965f29f9be1d1181222f2d3ef428da2b.tar.gz zsh-eeeba19c965f29f9be1d1181222f2d3ef428da2b.tar.xz zsh-eeeba19c965f29f9be1d1181222f2d3ef428da2b.zip |
42185: safety when removing separators in completion
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/compcore.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 52b0c173f..c3b971e0d 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -1901,7 +1901,8 @@ set_comp_sep(void) p = compwords[i] = (char *) getdata(n); untokenize(p); } - compcurrent = cur + 1; + /* The current position shouldn't exceed the new word count */ + compcurrent = cur + 1 > i ? i : cur + 1; compwords[i] = NULL; } instring = ois; |