From b3aa3b77916007703b341bfd30c3647bdc355bc8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 25 Jul 2015 21:50:55 +0100 Subject: 35910: Don't add to raw lex buffer if lex stopped. This was causing a segmentation violation in completion when parsing an incomplete math expression, e.g. 'echo $((3*4)'. --- ChangeLog | 4 ++++ Src/input.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 899ff08e5..bffa104bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-07-25 Peter Stephenson + * 35910: Src/input.c: Don't add to raw lex buffer if lex + stopped. Fixes crash on completion of incomplete + math expresion e.g. '$((3*4)'. + * 35909: Src/utils.c: fix $((...) completion in _expand by normalising quoting of the math expression containing tokens. diff --git a/Src/input.c b/Src/input.c index 613f89a25..1efabadeb 100644 --- a/Src/input.c +++ b/Src/input.c @@ -222,7 +222,8 @@ ingetc(void) if (inputline()) break; } - zshlex_raw_add(lastc); + if (!lexstop) + zshlex_raw_add(lastc); return lastc; } -- cgit v1.2.3