mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.3471: crash when using CTRL-T after an empty search pattern
Problem: Crash when using CTRL-T after an empty search pattern. Solution: Bail out when there is no previous search pattern. (closes #8953)
This commit is contained in:
@@ -612,7 +612,8 @@ may_adjust_incsearch_highlighting(
|
||||
// NOTE: must call restore_last_search_pattern() before returning!
|
||||
save_last_search_pattern();
|
||||
|
||||
if (!do_incsearch_highlighting(firstc, &search_delim, is_state, &skiplen, &patlen))
|
||||
if (!do_incsearch_highlighting(firstc, &search_delim, is_state,
|
||||
&skiplen, &patlen))
|
||||
{
|
||||
restore_last_search_pattern();
|
||||
return OK;
|
||||
@@ -626,6 +627,11 @@ may_adjust_incsearch_highlighting(
|
||||
if (search_delim == ccline.cmdbuff[skiplen])
|
||||
{
|
||||
pat = last_search_pattern();
|
||||
if (pat == NULL)
|
||||
{
|
||||
restore_last_search_pattern();
|
||||
return FAIL;
|
||||
}
|
||||
skiplen = 0;
|
||||
patlen = (int)STRLEN(pat);
|
||||
}
|
||||
|
Reference in New Issue
Block a user