From 7674fd5936de3190f1fd3bba3ef82370a2941064 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 29 Jan 2016 10:40:18 -0300 Subject: [PATCH 1/2] completion: Fix crash when the complist provided by a script has nulls Can be reproduced with aspell_complete.pl 1.00 by setting an invalid dictionary with "/set spell_dict a" --- src/fe-common/core/completion.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c index a4715d23..1e7833a4 100644 --- a/src/fe-common/core/completion.c +++ b/src/fe-common/core/completion.c @@ -217,6 +217,11 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i want_space = TRUE; signal_emit("complete word", 5, &complist, window, word, linestart, &want_space); last_want_space = want_space; + + if (complist != NULL) { + /* Remove all nulls (from the signal) before doing further processing */ + complist = g_list_remove_all(g_list_first(complist), NULL); + } } g_free(linestart); From 8708d8da49d68057ee8f32e64415c7109d237bd7 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Sun, 31 Jan 2016 20:49:59 +0200 Subject: [PATCH 2/2] Add .gitattributes to ensure all shell scripts have LF as eol-style. Some Git clients on Windows may use CRLF otherwise, which effectively prevents running such scripts. --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..e1ae7d9d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# On Windows, some Git clients may normalize all text files' line-endings to +# CRLF, which causes obscure errors when running shell scripts. +*.sh eol=lf