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:
@@ -4521,13 +4521,14 @@ get_address(
|
||||
if (lnum != MAXLNUM)
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
/*
|
||||
* Start a forward search at the end of the line.
|
||||
* Start a forward search at the end of the line (unless
|
||||
* before the first line).
|
||||
* Start a backward search at the start of the line.
|
||||
* This makes sure we never match in the current
|
||||
* line, and can match anywhere in the
|
||||
* next/previous line.
|
||||
*/
|
||||
if (c == '/')
|
||||
if (c == '/' && curwin->w_cursor.lnum > 0)
|
||||
curwin->w_cursor.col = MAXCOL;
|
||||
else
|
||||
curwin->w_cursor.col = 0;
|
||||
|
Reference in New Issue
Block a user