To: vim_dev@googlegroups.com Subject: Patch 8.2.3482 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3482 Problem: Reading beyond end of line ending in quote and backslash. Solution: Check for non-NUL after backslash. (closes #8964) Files: src/cindent.c, src/testdir/test_cindent.vim *** ../vim-8.2.3481/src/cindent.c 2021-07-27 21:00:39.737712414 +0100 --- src/cindent.c 2021-10-05 21:51:36.499208231 +0100 *************** *** 82,91 **** { if (p[0] == '\'') // 'c' or '\n' or '\000' { ! if (!p[1]) // ' at end of line break; i = 2; ! if (p[1] == '\\') // '\n' or '\000' { ++i; while (vim_isdigit(p[i - 1])) // '\000' --- 82,91 ---- { if (p[0] == '\'') // 'c' or '\n' or '\000' { ! if (p[1] == NUL) // ' at end of line break; i = 2; ! if (p[1] == '\\' && p[2] != NUL) // '\n' or '\000' { ++i; while (vim_isdigit(p[i - 1])) // '\000' *** ../vim-8.2.3481/src/testdir/test_cindent.vim 2020-08-12 17:50:31.871655841 +0100 --- src/testdir/test_cindent.vim 2021-10-05 21:50:50.054588333 +0100 *************** *** 5307,5310 **** --- 5307,5317 ---- enew! | close endfunc + func Test_backslash_at_end_of_line() + new + exe "norm v>O'\\\-" + exe "norm \=" + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.3481/src/version.c 2021-10-05 19:44:00.859799210 +0100 --- src/version.c 2021-10-05 21:48:05.752374508 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3482, /**/ -- hundred-and-one symptoms of being an internet addict: 106. When told to "go to your room" you inform your parents that you can't...because you were kicked out and banned. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///