cf6ca5c
To: vim-dev@vim.org
cf6ca5c
Subject: Patch 7.1.183
cf6ca5c
Fcc: outbox
cf6ca5c
From: Bram Moolenaar <Bram@moolenaar.net>
cf6ca5c
Mime-Version: 1.0
cf6ca5c
Content-Type: text/plain; charset=ISO-8859-1
cf6ca5c
Content-Transfer-Encoding: 8bit
cf6ca5c
------------
cf6ca5c
cf6ca5c
Patch 7.1.183
cf6ca5c
Problem:    "Internal error" for ":echo matchstr('a', 'a\%[\&]')" (Mitanu
cf6ca5c
	    Paul)
cf6ca5c
Solution:   Inside "\%[]" detect \&, \| and \) as an error.
cf6ca5c
Files:	    src/regexp.c
cf6ca5c
cf6ca5c
cf6ca5c
*** ../vim-7.1.182/src/regexp.c	Sun Dec  9 19:25:35 2007
cf6ca5c
--- src/regexp.c	Wed Jan  2 15:02:37 2008
cf6ca5c
***************
cf6ca5c
*** 1288,1295 ****
cf6ca5c
  }
cf6ca5c
  
cf6ca5c
  /*
cf6ca5c
!  * regbranch - one alternative of an | operator
cf6ca5c
!  *
cf6ca5c
   * Implements the & operator.
cf6ca5c
   */
cf6ca5c
      static char_u *
cf6ca5c
--- 1288,1294 ----
cf6ca5c
  }
cf6ca5c
  
cf6ca5c
  /*
cf6ca5c
!  * Handle one alternative of an | operator.
cf6ca5c
   * Implements the & operator.
cf6ca5c
   */
cf6ca5c
      static char_u *
cf6ca5c
***************
cf6ca5c
*** 1330,1337 ****
cf6ca5c
  }
cf6ca5c
  
cf6ca5c
  /*
cf6ca5c
!  * regbranch - one alternative of an | or & operator
cf6ca5c
!  *
cf6ca5c
   * Implements the concatenation operator.
cf6ca5c
   */
cf6ca5c
      static char_u *
cf6ca5c
--- 1329,1335 ----
cf6ca5c
  }
cf6ca5c
  
cf6ca5c
  /*
cf6ca5c
!  * Handle one alternative of an | or & operator.
cf6ca5c
   * Implements the concatenation operator.
cf6ca5c
   */
cf6ca5c
      static char_u *
cf6ca5c
***************
cf6ca5c
*** 1708,1713 ****
cf6ca5c
--- 1706,1713 ----
cf6ca5c
        case Magic('|'):
cf6ca5c
        case Magic('&'):
cf6ca5c
        case Magic(')'):
cf6ca5c
+ 	if (one_exactly)
cf6ca5c
+ 	    EMSG_ONE_RET_NULL;
cf6ca5c
  	EMSG_RET_NULL(_(e_internal));	/* Supposed to be caught earlier. */
cf6ca5c
  	/* NOTREACHED */
cf6ca5c
  
cf6ca5c
***************
cf6ca5c
*** 3106,3112 ****
cf6ca5c
   * slow, we keep one allocated piece of memory and only re-allocate it when
cf6ca5c
   * it's too small.  It's freed in vim_regexec_both() when finished.
cf6ca5c
   */
cf6ca5c
! static char_u	*reg_tofree;
cf6ca5c
  static unsigned	reg_tofreelen;
cf6ca5c
  
cf6ca5c
  /*
cf6ca5c
--- 3106,3112 ----
cf6ca5c
   * slow, we keep one allocated piece of memory and only re-allocate it when
cf6ca5c
   * it's too small.  It's freed in vim_regexec_both() when finished.
cf6ca5c
   */
cf6ca5c
! static char_u	*reg_tofree = NULL;
cf6ca5c
  static unsigned	reg_tofreelen;
cf6ca5c
  
cf6ca5c
  /*
cf6ca5c
*** ../vim-7.1.182/src/version.c	Wed Jan  2 15:12:29 2008
cf6ca5c
--- src/version.c	Wed Jan  2 15:33:52 2008
cf6ca5c
***************
cf6ca5c
*** 668,669 ****
cf6ca5c
--- 668,671 ----
cf6ca5c
  {   /* Add new patch number below this line */
cf6ca5c
+ /**/
cf6ca5c
+     183,
cf6ca5c
  /**/
cf6ca5c
cf6ca5c
-- 
cf6ca5c
Not too long ago, unzipping in public was illegal...
cf6ca5c
cf6ca5c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
cf6ca5c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
cf6ca5c
\\\        download, build and distribute -- http://www.A-A-P.org        ///
cf6ca5c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///