From 81ba83797240f38769a624a98c1e73ba2f9f9906 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 28 Mar 2015 21:24:27 -0700 Subject: 34781: add implicit space after alias expansion of tokens that form words without spacing fixes crash when using completion immediately following such an alias --- Src/lex.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Src') diff --git a/Src/lex.c b/Src/lex.c index 2e611707e..5fed2be49 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -1747,6 +1747,16 @@ checkalias(void) if (an && !an->inuse && ((an->node.flags & ALIAS_GLOBAL) || (incmdpos && tok == STRING) || inalmore)) { + if (!lexstop) { + /* + * Tokens that don't require a space after, get one, + * because they are treated as if preceded by one. + */ + int c = hgetc(); + hungetc(c); + if (!iblank(c)) + inpush(" ", INP_ALIAS, 0); + } inpush(an->text, INP_ALIAS, an); if (an->text[0] == ' ' && !(an->node.flags & ALIAS_GLOBAL)) aliasspaceflag = 1; -- cgit 1.4.1