lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
2f823cc
To: vim-dev@vim.org
2f823cc
Subject: Patch 7.2.391
2f823cc
Fcc: outbox
2f823cc
From: Bram Moolenaar <Bram@moolenaar.net>
2f823cc
Mime-Version: 1.0
2f823cc
Content-Type: text/plain; charset=UTF-8
2f823cc
Content-Transfer-Encoding: 8bit
2f823cc
------------
2f823cc
2f823cc
Patch 7.2.391
2f823cc
Problem:    Internal alloc(0) error when doing "CTRL-V $ c". (Martti Kuparinen)
2f823cc
Solution:   Fix computations in getvcol(). (partly by Lech Lorens)
2f823cc
Files:	    src/charset.c, src/memline.c
2f823cc
2f823cc
2f823cc
*** ../vim-7.2.390/src/charset.c	2009-11-03 16:03:59.000000000 +0100
2f823cc
--- src/charset.c	2010-03-10 14:38:14.000000000 +0100
2f823cc
***************
2f823cc
*** 1255,1261 ****
2f823cc
  
2f823cc
      vcol = 0;
2f823cc
      ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
2f823cc
!     posptr = ptr + pos->col;
2f823cc
  
2f823cc
      /*
2f823cc
       * This function is used very often, do some speed optimizations.
2f823cc
--- 1255,1264 ----
2f823cc
  
2f823cc
      vcol = 0;
2f823cc
      ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
2f823cc
!     if (pos->col == MAXCOL)
2f823cc
! 	posptr = NULL;  /* continue until the NUL */
2f823cc
!     else
2f823cc
! 	posptr = ptr + pos->col;
2f823cc
  
2f823cc
      /*
2f823cc
       * This function is used very often, do some speed optimizations.
2f823cc
***************
2f823cc
*** 1313,1319 ****
2f823cc
  		    incr = CHARSIZE(c);
2f823cc
  	    }
2f823cc
  
2f823cc
! 	    if (ptr >= posptr)	/* character at pos->col */
2f823cc
  		break;
2f823cc
  
2f823cc
  	    vcol += incr;
2f823cc
--- 1316,1322 ----
2f823cc
  		    incr = CHARSIZE(c);
2f823cc
  	    }
2f823cc
  
2f823cc
! 	    if (posptr != NULL && ptr >= posptr) /* character at pos->col */
2f823cc
  		break;
2f823cc
  
2f823cc
  	    vcol += incr;
2f823cc
***************
2f823cc
*** 1334,1340 ****
2f823cc
  		break;
2f823cc
  	    }
2f823cc
  
2f823cc
! 	    if (ptr >= posptr)	/* character at pos->col */
2f823cc
  		break;
2f823cc
  
2f823cc
  	    vcol += incr;
2f823cc
--- 1337,1343 ----
2f823cc
  		break;
2f823cc
  	    }
2f823cc
  
2f823cc
! 	    if (posptr != NULL && ptr >= posptr) /* character at pos->col */
2f823cc
  		break;
2f823cc
  
2f823cc
  	    vcol += incr;
2f823cc
*** ../vim-7.2.390/src/memline.c	2010-02-11 18:54:38.000000000 +0100
2f823cc
--- src/memline.c	2010-03-10 14:38:25.000000000 +0100
2f823cc
***************
2f823cc
*** 2113,2124 ****
2f823cc
      if (buf->b_ml.ml_mfp == NULL)	/* there are no lines */
2f823cc
  	return (char_u *)"";
2f823cc
  
2f823cc
! /*
2f823cc
!  * See if it is the same line as requested last time.
2f823cc
!  * Otherwise may need to flush last used line.
2f823cc
!  * Don't use the last used line when 'swapfile' is reset, need to load all
2f823cc
!  * blocks.
2f823cc
!  */
2f823cc
      if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release)
2f823cc
      {
2f823cc
  	ml_flush_line(buf);
2f823cc
--- 2113,2124 ----
2f823cc
      if (buf->b_ml.ml_mfp == NULL)	/* there are no lines */
2f823cc
  	return (char_u *)"";
2f823cc
  
2f823cc
!     /*
2f823cc
!      * See if it is the same line as requested last time.
2f823cc
!      * Otherwise may need to flush last used line.
2f823cc
!      * Don't use the last used line when 'swapfile' is reset, need to load all
2f823cc
!      * blocks.
2f823cc
!      */
2f823cc
      if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release)
2f823cc
      {
2f823cc
  	ml_flush_line(buf);
2f823cc
*** ../vim-7.2.390/src/version.c	2010-03-10 14:15:28.000000000 +0100
2f823cc
--- src/version.c	2010-03-10 14:31:02.000000000 +0100
2f823cc
***************
2f823cc
*** 683,684 ****
2f823cc
--- 683,686 ----
2f823cc
  {   /* Add new patch number below this line */
2f823cc
+ /**/
2f823cc
+     391,
2f823cc
  /**/
2f823cc
2f823cc
-- 
2f823cc
WOMAN:   King of the who?
2f823cc
ARTHUR:  The Britons.
2f823cc
WOMAN:   Who are the Britons?
2f823cc
ARTHUR:  Well, we all are. we're all Britons and I am your king.
2f823cc
                                  The Quest for the Holy Grail (Monty Python)
2f823cc
2f823cc
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
2f823cc
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
2f823cc
\\\        download, build and distribute -- http://www.A-A-P.org        ///
2f823cc
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///