1
0
forked from aniani/vim

updated for version 7.3.1127

Problem:    No error for using empty \%[].
Solution:   Give error message.
This commit is contained in:
Bram Moolenaar
2013-06-05 21:30:37 +02:00
parent c19b4b50a8
commit 2976c028ca
3 changed files with 7 additions and 2 deletions

View File

@@ -366,7 +366,7 @@ static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here");
static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here"); static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here");
#endif #endif
static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%["); static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%[");
static char_u e_empty_sb[] = N_("E70: Empty %s%%[]");
#define NOT_MULTI 0 #define NOT_MULTI 0
#define MULTI_ONE 1 #define MULTI_ONE 1
#define MULTI_MULT 2 #define MULTI_MULT 2
@@ -2227,7 +2227,7 @@ regatom(flagp)
return NULL; return NULL;
} }
if (ret == NULL) if (ret == NULL)
EMSG2_RET_NULL(_("E70: Empty %s%%[]"), EMSG2_RET_NULL(_(e_empty_sb),
reg_magic == MAGIC_ALL); reg_magic == MAGIC_ALL);
lastbranch = regnode(BRANCH); lastbranch = regnode(BRANCH);
br = regnode(NOTHING); br = regnode(NOTHING);

View File

@@ -977,6 +977,9 @@ nfa_regatom()
reg_magic == MAGIC_ALL); reg_magic == MAGIC_ALL);
EMIT(c); EMIT(c);
} }
if (n == 0)
EMSG2_RET_FAIL(_(e_empty_sb),
reg_magic == MAGIC_ALL);
EMIT(NFA_OPT_CHARS); EMIT(NFA_OPT_CHARS);
EMIT(n); EMIT(n);
break; break;

View File

@@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1127,
/**/ /**/
1126, 1126,
/**/ /**/