From eeeba19c965f29f9be1d1181222f2d3ef428da2b Mon Sep 17 00:00:00 2001 From: dana Date: Thu, 28 Dec 2017 01:47:57 -0600 Subject: 42185: safety when removing separators in completion --- ChangeLog | 3 +++ Src/Zle/compcore.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c05b9e06c..9d82e228b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2018-05-11 Peter Stephenson + * 42180: dana: Src/Zle/compcore.c: safety when removing + separators in completion. + * 42101 (tweaked): dana: Src/exec.c, Test/A06assign.ztst: assigning shell status to array was broken. 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; -- cgit 1.4.1