Karsten Hopp 5a8d3b
To: vim_dev@googlegroups.com
Karsten Hopp 5a8d3b
Subject: Patch 7.3.1127
Karsten Hopp 5a8d3b
Fcc: outbox
Karsten Hopp 5a8d3b
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 5a8d3b
Mime-Version: 1.0
Karsten Hopp 5a8d3b
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 5a8d3b
Content-Transfer-Encoding: 8bit
Karsten Hopp 5a8d3b
------------
Karsten Hopp 5a8d3b
Karsten Hopp 5a8d3b
Patch 7.3.1127
Karsten Hopp 5a8d3b
Problem:    No error for using empty \%[].
Karsten Hopp 5a8d3b
Solution:   Give error message.
Karsten Hopp 5a8d3b
Files:	    src/regexp.c, src/regexp_nfa.c
Karsten Hopp 5a8d3b
Karsten Hopp 5a8d3b
Karsten Hopp 5a8d3b
*** ../vim-7.3.1126/src/regexp.c	2013-06-05 16:33:05.000000000 +0200
Karsten Hopp 5a8d3b
--- src/regexp.c	2013-06-05 21:26:46.000000000 +0200
Karsten Hopp 5a8d3b
***************
Karsten Hopp 5a8d3b
*** 366,372 ****
Karsten Hopp 5a8d3b
  static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here");
Karsten Hopp 5a8d3b
  #endif
Karsten Hopp 5a8d3b
  static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%[");
Karsten Hopp 5a8d3b
! 
Karsten Hopp 5a8d3b
  #define NOT_MULTI	0
Karsten Hopp 5a8d3b
  #define MULTI_ONE	1
Karsten Hopp 5a8d3b
  #define MULTI_MULT	2
Karsten Hopp 5a8d3b
--- 366,372 ----
Karsten Hopp 5a8d3b
  static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here");
Karsten Hopp 5a8d3b
  #endif
Karsten Hopp 5a8d3b
  static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%[");
Karsten Hopp 5a8d3b
! static char_u e_empty_sb[]  = N_("E70: Empty %s%%[]");
Karsten Hopp 5a8d3b
  #define NOT_MULTI	0
Karsten Hopp 5a8d3b
  #define MULTI_ONE	1
Karsten Hopp 5a8d3b
  #define MULTI_MULT	2
Karsten Hopp 5a8d3b
***************
Karsten Hopp 5a8d3b
*** 2227,2233 ****
Karsten Hopp 5a8d3b
  				      return NULL;
Karsten Hopp 5a8d3b
  			      }
Karsten Hopp 5a8d3b
  			      if (ret == NULL)
Karsten Hopp 5a8d3b
! 				  EMSG2_RET_NULL(_("E70: Empty %s%%[]"),
Karsten Hopp 5a8d3b
  						      reg_magic == MAGIC_ALL);
Karsten Hopp 5a8d3b
  			      lastbranch = regnode(BRANCH);
Karsten Hopp 5a8d3b
  			      br = regnode(NOTHING);
Karsten Hopp 5a8d3b
--- 2227,2233 ----
Karsten Hopp 5a8d3b
  				      return NULL;
Karsten Hopp 5a8d3b
  			      }
Karsten Hopp 5a8d3b
  			      if (ret == NULL)
Karsten Hopp 5a8d3b
! 				  EMSG2_RET_NULL(_(e_empty_sb),
Karsten Hopp 5a8d3b
  						      reg_magic == MAGIC_ALL);
Karsten Hopp 5a8d3b
  			      lastbranch = regnode(BRANCH);
Karsten Hopp 5a8d3b
  			      br = regnode(NOTHING);
Karsten Hopp 5a8d3b
*** ../vim-7.3.1126/src/regexp_nfa.c	2013-06-05 21:23:33.000000000 +0200
Karsten Hopp 5a8d3b
--- src/regexp_nfa.c	2013-06-05 21:29:07.000000000 +0200
Karsten Hopp 5a8d3b
***************
Karsten Hopp 5a8d3b
*** 977,982 ****
Karsten Hopp 5a8d3b
--- 977,985 ----
Karsten Hopp 5a8d3b
  						      reg_magic == MAGIC_ALL);
Karsten Hopp 5a8d3b
  			    EMIT(c);
Karsten Hopp 5a8d3b
  			}
Karsten Hopp 5a8d3b
+ 			if (n == 0)
Karsten Hopp 5a8d3b
+ 			    EMSG2_RET_FAIL(_(e_empty_sb),
Karsten Hopp 5a8d3b
+ 						      reg_magic == MAGIC_ALL);
Karsten Hopp 5a8d3b
  			EMIT(NFA_OPT_CHARS);
Karsten Hopp 5a8d3b
  			EMIT(n);
Karsten Hopp 5a8d3b
  			break;
Karsten Hopp 5a8d3b
*** ../vim-7.3.1126/src/version.c	2013-06-05 21:23:33.000000000 +0200
Karsten Hopp 5a8d3b
--- src/version.c	2013-06-05 21:29:48.000000000 +0200
Karsten Hopp 5a8d3b
***************
Karsten Hopp 5a8d3b
*** 730,731 ****
Karsten Hopp 5a8d3b
--- 730,733 ----
Karsten Hopp 5a8d3b
  {   /* Add new patch number below this line */
Karsten Hopp 5a8d3b
+ /**/
Karsten Hopp 5a8d3b
+     1127,
Karsten Hopp 5a8d3b
  /**/
Karsten Hopp 5a8d3b
Karsten Hopp 5a8d3b
-- 
Karsten Hopp 5a8d3b
From "know your smileys":
Karsten Hopp 5a8d3b
 8-O 	"Omigod!!" (done "rm -rf *" ?)
Karsten Hopp 5a8d3b
Karsten Hopp 5a8d3b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 5a8d3b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 5a8d3b
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 5a8d3b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///