9b43b3a
To: vim-dev@vim.org
9b43b3a
Subject: Patch 7.1.287
9b43b3a
Fcc: outbox
9b43b3a
From: Bram Moolenaar <Bram@moolenaar.net>
9b43b3a
Mime-Version: 1.0
9b43b3a
Content-Type: text/plain; charset=ISO-8859-1
9b43b3a
Content-Transfer-Encoding: 8bit
9b43b3a
------------
9b43b3a
9b43b3a
Patch 7.1.287
9b43b3a
Problem:    Crash when reversing a list after using it. (Andy Wokula)
9b43b3a
Solution:   Update the pointer to the last used element. (Dominique Pelle)
9b43b3a
Files:	    src/eval.c
9b43b3a
9b43b3a
9b43b3a
*** ../vim-7.1.286/src/eval.c	Thu Mar 20 13:22:47 2008
9b43b3a
--- src/eval.c	Tue Apr  1 12:36:41 2008
9b43b3a
***************
9b43b3a
*** 13954,13959 ****
9b43b3a
--- 13954,13960 ----
9b43b3a
  	rettv->vval.v_list = l;
9b43b3a
  	rettv->v_type = VAR_LIST;
9b43b3a
  	++l->lv_refcount;
9b43b3a
+ 	l->lv_idx = l->lv_len - l->lv_idx - 1;
9b43b3a
      }
9b43b3a
  }
9b43b3a
  
9b43b3a
***************
9b43b3a
*** 15202,15208 ****
9b43b3a
  	    if (!item_compare_func_err)
9b43b3a
  	    {
9b43b3a
  		/* Clear the List and append the items in the sorted order. */
9b43b3a
! 		l->lv_first = l->lv_last = NULL;
9b43b3a
  		l->lv_len = 0;
9b43b3a
  		for (i = 0; i < len; ++i)
9b43b3a
  		    list_append(l, ptrs[i]);
9b43b3a
--- 15203,15209 ----
9b43b3a
  	    if (!item_compare_func_err)
9b43b3a
  	    {
9b43b3a
  		/* Clear the List and append the items in the sorted order. */
9b43b3a
! 		l->lv_first = l->lv_last = l->lv_idx_item = NULL;
9b43b3a
  		l->lv_len = 0;
9b43b3a
  		for (i = 0; i < len; ++i)
9b43b3a
  		    list_append(l, ptrs[i]);
9b43b3a
*** ../vim-7.1.286/src/version.c	Tue Apr  1 12:05:49 2008
9b43b3a
--- src/version.c	Tue Apr  1 13:09:10 2008
9b43b3a
***************
9b43b3a
*** 668,669 ****
9b43b3a
--- 668,671 ----
9b43b3a
  {   /* Add new patch number below this line */
9b43b3a
+ /**/
9b43b3a
+     287,
9b43b3a
  /**/
9b43b3a
9b43b3a
-- 
9b43b3a
hundred-and-one symptoms of being an internet addict:
9b43b3a
203. You're an active member of more than 20 newsgroups.
9b43b3a
9b43b3a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
9b43b3a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
9b43b3a
\\\        download, build and distribute -- http://www.A-A-P.org        ///
9b43b3a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///