1
0
forked from aniani/vim

patch 8.0.1416: crash when searching for a sentence

Problem:    Crash when searching for a sentence.
Solution:   Return NUL when getting character at MAXCOL. (closes #2468)
This commit is contained in:
Bram Moolenaar
2017-12-19 21:23:21 +01:00
parent 4ce46c2a6b
commit 8ada6aa929
5 changed files with 33 additions and 14 deletions

View File

@@ -2650,8 +2650,12 @@ del_lines(
int
gchar_pos(pos_T *pos)
{
char_u *ptr = ml_get_pos(pos);
char_u *ptr;
/* When searching columns is sometimes put at the end of a line. */
if (pos->col == MAXCOL)
return NUL;
ptr = ml_get_pos(pos);
#ifdef FEAT_MBYTE
if (has_mbyte)
return (*mb_ptr2char)(ptr);