# HG changeset patch # User Bram Moolenaar # Date 1366035262 -7200 # Node ID 166b3df562ead7b4f85a494fb8a6eef40affdf85 # Parent 249bec0bf8dc79628d77f66a45c4ff07b8903d1a updated for version 7.3.903 Problem: Crash on exit writing viminfo. (Ron Aaron) Solution: Check for the history to be empty. diff --git a/src/ex_getln.c b/src/ex_getln.c --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -6216,7 +6216,15 @@ write_viminfo_history(fp) */ for (round = 1; round <= 2; ++round) { - i = round == 1 ? hisidx[type] : 0; + if (round == 1) + /* start at newest entry, somewhere in the list */ + i = hisidx[type]; + else if (viminfo_hisidx[type] > 0) + /* start at newest entry, first in the list */ + i = 0; + else + /* empty list */ + i = -1; if (i >= 0) while (num_saved > 0 && !(round == 2 && i >= viminfo_hisidx[type])) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 903, +/**/ 902, /**/ 901,