mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #9625 from janlazo/vim-8.1.0945
This commit is contained in:
commit
9cf600e702
@ -772,7 +772,7 @@ static int get_equi_class(char_u **pp)
|
||||
int l = 1;
|
||||
char_u *p = *pp;
|
||||
|
||||
if (p[1] == '=') {
|
||||
if (p[1] == '=' && p[2] != NUL) {
|
||||
l = (*mb_ptr2len)(p + 2);
|
||||
if (p[l + 2] == '=' && p[l + 3] == ']') {
|
||||
c = utf_ptr2char(p + 2);
|
||||
@ -1103,7 +1103,7 @@ static int get_coll_element(char_u **pp)
|
||||
int l = 1;
|
||||
char_u *p = *pp;
|
||||
|
||||
if (p[0] != NUL && p[1] == '.') {
|
||||
if (p[0] != NUL && p[1] == '.' && p[2] != NUL) {
|
||||
l = utfc_ptr2len(p + 2);
|
||||
if (p[l + 2] == '.' && p[l + 3] == ']') {
|
||||
c = utf_ptr2char(p + 2);
|
||||
|
@ -1691,15 +1691,16 @@ collection:
|
||||
) {
|
||||
MB_PTR_ADV(regparse);
|
||||
|
||||
if (*regparse == 'n')
|
||||
startc = reg_string ? NL : NFA_NEWL;
|
||||
else if (*regparse == 'd'
|
||||
|| *regparse == 'o'
|
||||
|| *regparse == 'x'
|
||||
|| *regparse == 'u'
|
||||
|| *regparse == 'U'
|
||||
) {
|
||||
/* TODO(RE) This needs more testing */
|
||||
if (*regparse == 'n') {
|
||||
startc = (reg_string || emit_range || regparse[1] == '-')
|
||||
? NL : NFA_NEWL;
|
||||
} else if (*regparse == 'd'
|
||||
|| *regparse == 'o'
|
||||
|| *regparse == 'x'
|
||||
|| *regparse == 'u'
|
||||
|| *regparse == 'U'
|
||||
) {
|
||||
// TODO(RE): This needs more testing
|
||||
startc = coll_get_char();
|
||||
got_coll_char = true;
|
||||
MB_PTR_BACK(old_regparse, regparse);
|
||||
|
@ -30,3 +30,20 @@ func Test_equivalence_re2()
|
||||
set re=2
|
||||
call s:equivalence_test()
|
||||
endfunc
|
||||
|
||||
func Test_range_with_newline()
|
||||
new
|
||||
call setline(1, "a")
|
||||
call assert_equal(0, search("[ -*\\n- ]"))
|
||||
call assert_equal(0, search("[ -*\\t-\\n]"))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_get_equi_class()
|
||||
new
|
||||
" Incomplete equivalence class caused invalid memory access
|
||||
s/^/[[=
|
||||
call assert_equal(1, search(getline(1)))
|
||||
s/.*/[[.
|
||||
call assert_equal(1, search(getline(1)))
|
||||
endfunc
|
||||
|
Loading…
Reference in New Issue
Block a user