summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-11-28 14:20:17 +0100
committerBram Moolenaar <Bram@vim.org>2013-11-28 14:20:17 +0100
commit174a848b677c6cd66def00d36a2b25332ca49e38 (patch)
tree7f3eb1596727c3566b119849cbfb3e39546bd0de
parent3678208477b1f0586128f7f18a6382d342c0c960 (diff)
updated for version 7.4.104v7.4.104
Problem: ":help s/\_" reports an internal error. (John Beckett) Solution: Check for NUL and invalid character classes.
-rw-r--r--src/regexp_nfa.c15
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index cf7694bb0b..787b34366a 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -239,7 +239,9 @@ static int nfa_classcodes[] = {
NFA_UPPER, NFA_NUPPER
};
+static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely");
static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c");
+static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %ld");
/* NFA regexp \ze operator encountered. */
static int nfa_has_zend;
@@ -1137,7 +1139,7 @@ nfa_regatom()
switch (c)
{
case NUL:
- EMSG_RET_FAIL(_("E865: (NFA) Regexp end encountered prematurely"));
+ EMSG_RET_FAIL(_(e_nul_found));
case Magic('^'):
EMIT(NFA_BOL);
@@ -1160,6 +1162,9 @@ nfa_regatom()
case Magic('_'):
c = no_Magic(getchr());
+ if (c == NUL)
+ EMSG_RET_FAIL(_(e_nul_found));
+
if (c == '^') /* "\_^" is start-of-line */
{
EMIT(NFA_BOL);
@@ -1216,6 +1221,12 @@ nfa_regatom()
p = vim_strchr(classchars, no_Magic(c));
if (p == NULL)
{
+ if (extra == NFA_ADD_NL)
+ {
+ EMSGN(_(e_ill_char_class), c);
+ rc_did_emsg = TRUE;
+ return FAIL;
+ }
EMSGN("INTERNAL: Unknown character class char: %ld", c);
return FAIL;
}
@@ -4733,7 +4744,7 @@ check_char_class(class, c)
default:
/* should not be here :P */
- EMSGN("E877: (NFA regexp) Invalid character class: %ld", class);
+ EMSGN(_(e_ill_char_class), class);
return FAIL;
}
return FAIL;
diff --git a/src/version.c b/src/version.c
index d8f95dd472..02c659e70d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 104,
+/**/
103,
/**/
102,