Merge #7939 "fix crash: 'spell' and long lines"

This commit is contained in:
Justin M. Keyes
2018-02-11 13:04:39 +01:00
2 changed files with 53 additions and 3 deletions

View File

@@ -3353,10 +3353,11 @@ win_line (
/* Use nextline[] if possible, it has the start of the
* next line concatenated. */
if ((prev_ptr - line) - nextlinecol >= 0)
p = nextline + (prev_ptr - line) - nextlinecol;
else
if ((prev_ptr - line) - nextlinecol >= 0) {
p = nextline + ((prev_ptr - line) - nextlinecol);
} else {
p = prev_ptr;
}
cap_col -= (int)(prev_ptr - line);
size_t tmplen = spell_check(wp, p, &spell_hlf, &cap_col, nochange);
assert(tmplen <= INT_MAX);