73b4a68
To: vim-dev@vim.org
73b4a68
Subject: Patch 7.2.139
73b4a68
Fcc: outbox
73b4a68
From: Bram Moolenaar <Bram@moolenaar.net>
73b4a68
Mime-Version: 1.0
73b4a68
Content-Type: text/plain; charset=ISO-8859-1
73b4a68
Content-Transfer-Encoding: 8bit
73b4a68
------------
73b4a68
73b4a68
Patch 7.2.139
73b4a68
Problem:    Crash when 'virtualedit' is "all". (James Vega)
73b4a68
Solution:   Avoid overflow when column is MAXCOL. (Dominique Pelle)
73b4a68
Files:	    src/misc2.c
73b4a68
73b4a68
73b4a68
*** ../vim-7.2.138/src/misc2.c	Tue Feb 24 04:28:40 2009
73b4a68
--- src/misc2.c	Wed Mar 11 16:45:05 2009
73b4a68
***************
73b4a68
*** 496,502 ****
73b4a68
  {
73b4a68
      colnr_T len;
73b4a68
  #ifdef FEAT_VIRTUALEDIT
73b4a68
!     colnr_T oldcol = curwin->w_cursor.col + curwin->w_cursor.coladd;
73b4a68
  #endif
73b4a68
  
73b4a68
      len = (colnr_T)STRLEN(ml_get_curline());
73b4a68
--- 496,503 ----
73b4a68
  {
73b4a68
      colnr_T len;
73b4a68
  #ifdef FEAT_VIRTUALEDIT
73b4a68
!     colnr_T oldcol = curwin->w_cursor.col;
73b4a68
!     colnr_T oldcoladd = curwin->w_cursor.col + curwin->w_cursor.coladd;
73b4a68
  #endif
73b4a68
  
73b4a68
      len = (colnr_T)STRLEN(ml_get_curline());
73b4a68
***************
73b4a68
*** 535,541 ****
73b4a68
      if (oldcol == MAXCOL)
73b4a68
  	curwin->w_cursor.coladd = 0;
73b4a68
      else if (ve_flags == VE_ALL)
73b4a68
! 	curwin->w_cursor.coladd = oldcol - curwin->w_cursor.col;
73b4a68
  #endif
73b4a68
  }
73b4a68
  
73b4a68
--- 536,548 ----
73b4a68
      if (oldcol == MAXCOL)
73b4a68
  	curwin->w_cursor.coladd = 0;
73b4a68
      else if (ve_flags == VE_ALL)
73b4a68
!     {
73b4a68
! 	if (oldcoladd > curwin->w_cursor.col)
73b4a68
! 	    curwin->w_cursor.coladd = oldcoladd - curwin->w_cursor.col;
73b4a68
! 	else
73b4a68
! 	    /* avoid weird number when there is a miscalculation or overflow */
73b4a68
! 	    curwin->w_cursor.coladd = 0;
73b4a68
!     }
73b4a68
  #endif
73b4a68
  }
73b4a68
  
73b4a68
*** ../vim-7.2.138/src/version.c	Wed Mar 11 16:36:04 2009
73b4a68
--- src/version.c	Wed Mar 11 17:26:50 2009
73b4a68
***************
73b4a68
*** 678,679 ****
73b4a68
--- 678,681 ----
73b4a68
  {   /* Add new patch number below this line */
73b4a68
+ /**/
73b4a68
+     139,
73b4a68
  /**/
73b4a68
73b4a68
-- 
73b4a68
Some of the well know MS-Windows errors:
73b4a68
	EHUH		Unexpected error
73b4a68
	EUSER		User error, not our fault!
73b4a68
	EGOD		Horrible problem, god knows what has happened
73b4a68
	EERR		Errornous error: nothing wrong
73b4a68
73b4a68
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
73b4a68
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
73b4a68
\\\        download, build and distribute -- http://www.A-A-P.org        ///
73b4a68
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///