Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

updated for version 7.3.785

Problem:    Crash with specific use of search pattern.
Solution:   Initialize reg_buf to curbuf.
  • Loading branch information...
commit bfccf8b7c1e0aa01ad0dcd8dab17adbdeba24e07 1 parent 919cc50
authored January 25, 2013
9  src/regexp.c
@@ -3413,7 +3413,7 @@ static unsigned	reg_tofreelen;
3413 3413
  * reg_startpos		<invalid>		reg_mmatch->startpos
3414 3414
  * reg_endpos		<invalid>		reg_mmatch->endpos
3415 3415
  * reg_win		NULL			window in which to search
3416  
- * reg_buf		<invalid>		buffer in which to search
  3416
+ * reg_buf		curbuf			buffer in which to search
3417 3417
  * reg_firstlnum	<invalid>		first line in which to search
3418 3418
  * reg_maxline		0			last line nr
3419 3419
  * reg_line_lbr		FALSE or TRUE		FALSE
@@ -3571,6 +3571,7 @@ vim_regexec(rmp, line, col)
3571 3571
     reg_mmatch = NULL;
3572 3572
     reg_maxline = 0;
3573 3573
     reg_line_lbr = FALSE;
  3574
+    reg_buf = curbuf;
3574 3575
     reg_win = NULL;
3575 3576
     ireg_ic = rmp->rm_ic;
3576 3577
 #ifdef FEAT_MBYTE
@@ -3595,6 +3596,7 @@ vim_regexec_nl(rmp, line, col)
3595 3596
     reg_mmatch = NULL;
3596 3597
     reg_maxline = 0;
3597 3598
     reg_line_lbr = TRUE;
  3599
+    reg_buf = curbuf;
3598 3600
     reg_win = NULL;
3599 3601
     ireg_ic = rmp->rm_ic;
3600 3602
 #ifdef FEAT_MBYTE
@@ -4311,8 +4313,8 @@ regmatch(scan)
4311 4313
 #endif
4312 4314
 	    else
4313 4315
 	    {
4314  
-		if (!vim_iswordc_buf(c, reg_buf)
4315  
-			|| (reginput > regline && vim_iswordc_buf(reginput[-1], reg_buf)))
  4316
+		if (!vim_iswordc_buf(c, reg_buf) || (reginput > regline
  4317
+				   && vim_iswordc_buf(reginput[-1], reg_buf)))
4316 4318
 		    status = RA_NOMATCH;
4317 4319
 	    }
4318 4320
 	    break;
@@ -7135,6 +7137,7 @@ vim_regsub(rmp, source, dest, copy, magic, backslash)
7135 7137
     reg_match = rmp;
7136 7138
     reg_mmatch = NULL;
7137 7139
     reg_maxline = 0;
  7140
+    reg_buf = curbuf;
7138 7141
     return vim_regsub_both(source, dest, copy, magic, backslash);
7139 7142
 }
7140 7143
 #endif
2  src/version.c
@@ -726,6 +726,8 @@ static char *(features[]) =
726 726
 static int included_patches[] =
727 727
 {   /* Add new patch number below this line */
728 728
 /**/
  729
+    785,
  730
+/**/
729 731
     784,
730 732
 /**/
731 733
     783,

0 notes on commit bfccf8b

Please sign in to comment.
Something went wrong with that request. Please try again.