Blame SOURCES/7.4.437

d6ba96
To: vim_dev@googlegroups.com
d6ba96
Subject: Patch 7.4.437
d6ba96
Fcc: outbox
d6ba96
From: Bram Moolenaar <Bram@moolenaar.net>
d6ba96
Mime-Version: 1.0
d6ba96
Content-Type: text/plain; charset=UTF-8
d6ba96
Content-Transfer-Encoding: 8bit
d6ba96
------------
d6ba96
d6ba96
Patch 7.4.437
d6ba96
Problem:    New and old regexp engine are not consistent.
d6ba96
Solution:   Also give an error for "\ze*" for the old regexp engine.
d6ba96
Files:	    src/regexp.c, src/regexp_nfa.c
d6ba96
d6ba96
d6ba96
*** ../vim-7.4.436/src/regexp.c	2014-07-09 19:32:30.935678834 +0200
d6ba96
--- src/regexp.c	2014-09-09 17:11:32.444539356 +0200
d6ba96
***************
d6ba96
*** 358,363 ****
d6ba96
--- 358,365 ----
d6ba96
  static char_u	*regprop __ARGS((char_u *));
d6ba96
  #endif
d6ba96
  
d6ba96
+ static int re_mult_next __ARGS((char *what));
d6ba96
+ 
d6ba96
  static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
d6ba96
  static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
d6ba96
  static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
d6ba96
***************
d6ba96
*** 2166,2174 ****
d6ba96
--- 2168,2180 ----
d6ba96
  #endif
d6ba96
  
d6ba96
  		case 's': ret = regnode(MOPEN + 0);
d6ba96
+ 			  if (re_mult_next("\\zs") == FAIL)
d6ba96
+ 			      return NULL;
d6ba96
  			  break;
d6ba96
  
d6ba96
  		case 'e': ret = regnode(MCLOSE + 0);
d6ba96
+ 			  if (re_mult_next("\\ze") == FAIL)
d6ba96
+ 			      return NULL;
d6ba96
  			  break;
d6ba96
  
d6ba96
  		default:  EMSG_RET_NULL(_("E68: Invalid character after \\z"));
d6ba96
***************
d6ba96
*** 7005,7010 ****
d6ba96
--- 7011,7028 ----
d6ba96
  }
d6ba96
  #endif	    /* DEBUG */
d6ba96
  
d6ba96
+ /*
d6ba96
+  * Used in a place where no * or \+ can follow.
d6ba96
+  */
d6ba96
+     static int
d6ba96
+ re_mult_next(what)
d6ba96
+     char *what;
d6ba96
+ {
d6ba96
+     if (re_multi_type(peekchr()) == MULTI_MULT)
d6ba96
+ 	EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
d6ba96
+     return OK;
d6ba96
+ }
d6ba96
+ 
d6ba96
  #ifdef FEAT_MBYTE
d6ba96
  static void mb_decompose __ARGS((int c, int *c1, int *c2, int *c3));
d6ba96
  
d6ba96
*** ../vim-7.4.436/src/regexp_nfa.c	2014-08-29 11:56:21.350422045 +0200
d6ba96
--- src/regexp_nfa.c	2014-09-09 17:10:17.572539193 +0200
d6ba96
***************
d6ba96
*** 291,297 ****
d6ba96
  static int nfa_regconcat __ARGS((void));
d6ba96
  static int nfa_regbranch __ARGS((void));
d6ba96
  static int nfa_reg __ARGS((int paren));
d6ba96
- static int re_mult_next __ARGS((char *what));
d6ba96
  #ifdef DEBUG
d6ba96
  static void nfa_set_code __ARGS((int c));
d6ba96
  static void nfa_postfix_dump __ARGS((char_u *expr, int retval));
d6ba96
--- 291,296 ----
d6ba96
***************
d6ba96
*** 2281,2298 ****
d6ba96
      return OK;
d6ba96
  }
d6ba96
  
d6ba96
- /*
d6ba96
-  * Used in a place where no * or \+ can follow.
d6ba96
-  */
d6ba96
-     static int
d6ba96
- re_mult_next(what)
d6ba96
-     char *what;
d6ba96
- {
d6ba96
-     if (re_multi_type(peekchr()) == MULTI_MULT)
d6ba96
- 	EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
d6ba96
-     return OK;
d6ba96
- }
d6ba96
- 
d6ba96
  #ifdef DEBUG
d6ba96
  static char_u code[50];
d6ba96
  
d6ba96
--- 2280,2285 ----
d6ba96
*** ../vim-7.4.436/src/version.c	2014-09-09 16:59:34.792537789 +0200
d6ba96
--- src/version.c	2014-09-09 17:12:34.352539491 +0200
d6ba96
***************
d6ba96
*** 743,744 ****
d6ba96
--- 743,746 ----
d6ba96
  {   /* Add new patch number below this line */
d6ba96
+ /**/
d6ba96
+     437,
d6ba96
  /**/
d6ba96
d6ba96
-- 
d6ba96
hundred-and-one symptoms of being an internet addict:
d6ba96
110. You actually volunteer to become your employer's webmaster.
d6ba96
d6ba96
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
d6ba96
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
d6ba96
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
d6ba96
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///