summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-04-15 16:14:22 +0200
committerBram Moolenaar <Bram@vim.org>2013-04-15 16:14:22 +0200
commita8565fecc62e95a3a284be2ae20129cebe6432be (patch)
treec9025d582ae704c4c9c241518e196a3f0c3dd31d
parent4c7e9db0d6502054eafafcc9aea70ea71c45f551 (diff)
downloadvim-git-a8565fecc62e95a3a284be2ae20129cebe6432be.tar.gz
updated for version 7.3.903v7.3.903
Problem: Crash on exit writing viminfo. (Ron Aaron) Solution: Check for the history to be empty.
-rw-r--r--src/ex_getln.c10
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index c16c1ab38..a7a1409b0 100644
--- 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
index edeab45a3..cf06da600 100644
--- 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,