mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3482: reading beyond end of line ending in quote and backslash
Problem: Reading beyond end of line ending in quote and backslash.
Solution: Check for non-NUL after backslash. (closes vim/vim#8964)
78e0fa4cf4
This commit is contained in:
parent
b8d6ab04a2
commit
6714ea35ac
@ -152,11 +152,11 @@ static char_u *skip_string(char_u *p)
|
||||
*/
|
||||
for (;; p++) {
|
||||
if (p[0] == '\'') { // 'c' or '\n' or '\000'
|
||||
if (!p[1]) { // ' at end of line
|
||||
if (p[1] == NUL) { // ' at end of line
|
||||
break;
|
||||
}
|
||||
i = 2;
|
||||
if (p[1] == '\\') { // '\n' or '\000'
|
||||
if (p[1] == '\\' && p[2] != NUL) { // '\n' or '\000'
|
||||
i++;
|
||||
while (ascii_isdigit(p[i - 1])) { // '\000'
|
||||
i++;
|
||||
|
@ -5296,4 +5296,11 @@ func Test_cindent_pragma()
|
||||
enew! | close
|
||||
endfunc
|
||||
|
||||
func Test_backslash_at_end_of_line()
|
||||
new
|
||||
exe "norm v>O'\\\<C-m>-"
|
||||
exe "norm \<C-q>="
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Loading…
Reference in New Issue
Block a user