vim-patch:7.4.2357 (#6354)

Problem:    Attempt to read history entry while not initialized.
Solution:   Skip when the index is negative.

46643713dc
This commit is contained in:
raichoo 2017-03-26 23:15:53 +02:00 committed by Justin M. Keyes
parent f9a31e9850
commit edc80f6b46
2 changed files with 3 additions and 3 deletions

View File

@ -4677,8 +4677,8 @@ add_to_history (
* down, only lines that were added. * down, only lines that were added.
*/ */
if (histype == HIST_SEARCH && in_map) { if (histype == HIST_SEARCH && in_map) {
if (maptick == last_maptick) { if (maptick == last_maptick && hisidx[HIST_SEARCH] >= 0) {
/* Current line is from the same mapping, remove it */ // Current line is from the same mapping, remove it
hisptr = &history[HIST_SEARCH][hisidx[HIST_SEARCH]]; hisptr = &history[HIST_SEARCH][hisidx[HIST_SEARCH]];
hist_free_entry(hisptr); hist_free_entry(hisptr);
--hisnum[histype]; --hisnum[histype];

View File

@ -84,7 +84,7 @@ static int included_patches[] = {
// 2360, // 2360,
// 2359 NA // 2359 NA
// 2358 NA // 2358 NA
// 2357, 2357,
// 2356, // 2356,
2355, 2355,
// 2354, // 2354,