summaryrefslogtreecommitdiff
path: root/src/regexp_nfa.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-17 20:17:02 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-17 20:17:02 +0100
commita5483448cba6997517003a22a8029f0de1007d0e (patch)
tree77599292108fbba2fd93b46113fe8259e816efd0 /src/regexp_nfa.c
parentc85c8fcb9fad565da78e01248c12f662f6bc04c8 (diff)
downloadvim-git-a5483448cba6997517003a22a8029f0de1007d0e.tar.gz
patch 8.1.0945: internal error when using pattern with NL in the rangev8.1.0945
Problem: Internal error when using pattern with NL in the range. Solution: Use an actual newline for the range. (closes #3989) Also fix error message. (Dominique Pelle)
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r--src/regexp_nfa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index b83e309f7..9633791bc 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -245,7 +245,7 @@ static int nfa_classcodes[] = {
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");
+static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %d");
// Variables only used in nfa_regcomp() and descendants.
static int nfa_re_flags; // re_flags passed to nfa_regcomp()
@@ -1785,7 +1785,8 @@ collection:
MB_PTR_ADV(regparse);
if (*regparse == 'n')
- startc = reg_string ? NL : NFA_NEWL;
+ startc = (reg_string || emit_range
+ || regparse[1] == '-') ? NL : NFA_NEWL;
else
if (*regparse == 'd'
|| *regparse == 'o'