diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-12-23 07:41:23 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2021-12-23 07:41:23 +0800 |
commit | 6714ea35ac202eb7a3902eaff89840dfd8c80b8d (patch) | |
tree | 427b24d76ae5fcc48f11998a7e5eb350e29f315d /src/nvim/indent_c.c | |
parent | b8d6ab04a221b55ae240a85a0aba0b6a8b261fb4 (diff) | |
download | rneovim-6714ea35ac202eb7a3902eaff89840dfd8c80b8d.tar.gz rneovim-6714ea35ac202eb7a3902eaff89840dfd8c80b8d.tar.bz2 rneovim-6714ea35ac202eb7a3902eaff89840dfd8c80b8d.zip |
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)
https://github.com/vim/vim/commit/78e0fa4cf4fcd563c0bc8c87afa54d4f5dc22020
Diffstat (limited to 'src/nvim/indent_c.c')
-rw-r--r-- | src/nvim/indent_c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index faa9b38cf7..93bfe6d822 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -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++; |