Mercurial > vim
comparison src/regexp_nfa.c @ 15876:0c49755f460e v8.1.0945
patch 8.1.0945: internal error when using pattern with NL in the range
commit https://github.com/vim/vim/commit/a5483448cba6997517003a22a8029f0de1007d0e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 17 20:17:02 2019 +0100
patch 8.1.0945: internal error when using pattern with NL in the range
Problem: Internal error when using pattern with NL in the range.
Solution: Use an actual newline for the range. (closes https://github.com/vim/vim/issues/3989) Also fix
error message. (Dominique Pelle)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 Feb 2019 20:30:06 +0100 |
parents | 6733b8b1caf3 |
children | fec4416adb80 |
comparison
equal
deleted
inserted
replaced
15875:83e98f8ca667 | 15876:0c49755f460e |
---|---|
243 NFA_UPPER, NFA_NUPPER | 243 NFA_UPPER, NFA_NUPPER |
244 }; | 244 }; |
245 | 245 |
246 static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely"); | 246 static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely"); |
247 static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c"); | 247 static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c"); |
248 static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %ld"); | 248 static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %d"); |
249 | 249 |
250 // Variables only used in nfa_regcomp() and descendants. | 250 // Variables only used in nfa_regcomp() and descendants. |
251 static int nfa_re_flags; // re_flags passed to nfa_regcomp() | 251 static int nfa_re_flags; // re_flags passed to nfa_regcomp() |
252 static int *post_start; // holds the postfix form of r.e. | 252 static int *post_start; // holds the postfix form of r.e. |
253 static int *post_end; | 253 static int *post_end; |
1783 ) | 1783 ) |
1784 { | 1784 { |
1785 MB_PTR_ADV(regparse); | 1785 MB_PTR_ADV(regparse); |
1786 | 1786 |
1787 if (*regparse == 'n') | 1787 if (*regparse == 'n') |
1788 startc = reg_string ? NL : NFA_NEWL; | 1788 startc = (reg_string || emit_range |
1789 || regparse[1] == '-') ? NL : NFA_NEWL; | |
1789 else | 1790 else |
1790 if (*regparse == 'd' | 1791 if (*regparse == 'd' |
1791 || *regparse == 'o' | 1792 || *regparse == 'o' |
1792 || *regparse == 'x' | 1793 || *regparse == 'x' |
1793 || *regparse == 'u' | 1794 || *regparse == 'u' |