To: vim_dev@googlegroups.com
Subject: Patch 7.3.785
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.785 (after 7.3.776)
Problem:    Crash with specific use of search pattern.
Solution:   Initialize reg_buf to curbuf.
Files:	    src/regexp.c


*** ../vim-7.3.784/src/regexp.c	2013-01-23 15:53:08.000000000 +0100
--- src/regexp.c	2013-01-25 20:04:14.000000000 +0100
***************
*** 3413,3419 ****
   * reg_startpos		<invalid>		reg_mmatch->startpos
   * reg_endpos		<invalid>		reg_mmatch->endpos
   * reg_win		NULL			window in which to search
!  * reg_buf		<invalid>		buffer in which to search
   * reg_firstlnum	<invalid>		first line in which to search
   * reg_maxline		0			last line nr
   * reg_line_lbr		FALSE or TRUE		FALSE
--- 3413,3419 ----
   * reg_startpos		<invalid>		reg_mmatch->startpos
   * reg_endpos		<invalid>		reg_mmatch->endpos
   * reg_win		NULL			window in which to search
!  * reg_buf		curbuf			buffer in which to search
   * reg_firstlnum	<invalid>		first line in which to search
   * reg_maxline		0			last line nr
   * reg_line_lbr		FALSE or TRUE		FALSE
***************
*** 3571,3576 ****
--- 3571,3577 ----
      reg_mmatch = NULL;
      reg_maxline = 0;
      reg_line_lbr = FALSE;
+     reg_buf = curbuf;
      reg_win = NULL;
      ireg_ic = rmp->rm_ic;
  #ifdef FEAT_MBYTE
***************
*** 3595,3600 ****
--- 3596,3602 ----
      reg_mmatch = NULL;
      reg_maxline = 0;
      reg_line_lbr = TRUE;
+     reg_buf = curbuf;
      reg_win = NULL;
      ireg_ic = rmp->rm_ic;
  #ifdef FEAT_MBYTE
***************
*** 4311,4318 ****
  #endif
  	    else
  	    {
! 		if (!vim_iswordc_buf(c, reg_buf)
! 			|| (reginput > regline && vim_iswordc_buf(reginput[-1], reg_buf)))
  		    status = RA_NOMATCH;
  	    }
  	    break;
--- 4313,4320 ----
  #endif
  	    else
  	    {
! 		if (!vim_iswordc_buf(c, reg_buf) || (reginput > regline
! 				   && vim_iswordc_buf(reginput[-1], reg_buf)))
  		    status = RA_NOMATCH;
  	    }
  	    break;
***************
*** 7135,7140 ****
--- 7137,7143 ----
      reg_match = rmp;
      reg_mmatch = NULL;
      reg_maxline = 0;
+     reg_buf = curbuf;
      return vim_regsub_both(source, dest, copy, magic, backslash);
  }
  #endif
*** ../vim-7.3.784/src/version.c	2013-01-25 19:28:34.000000000 +0100
--- src/version.c	2013-01-25 20:09:30.000000000 +0100
***************
*** 727,728 ****
--- 727,730 ----
  {   /* Add new patch number below this line */
+ /**/
+     785,
  /**/

-- 
ARTHUR:  Well, I can't just call you `Man'.
DENNIS:  Well, you could say `Dennis'.
ARTHUR:  Well, I didn't know you were called `Dennis.'
DENNIS:  Well, you didn't bother to find out, did you?
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
