vim-patch:8.2.4968: reading past end of the line when C-indenting

Problem:    Reading past end of the line when C-indenting.
Solution:   Check for NUL.
60ae0e7149
This commit is contained in:
zeertzjq
2022-05-17 08:07:51 +08:00
parent b8c0eeaa30
commit 26c906f54d
2 changed files with 8 additions and 1 deletions

View File

@@ -150,7 +150,7 @@ static const char_u *skip_string(const char_u *p)
i++;
}
}
if (p[i] == '\'') { // check for trailing '
if (p[i - 1] != NUL && p[i] == '\'') { // check for trailing '
p += i;
continue;
}