Patch 8.2.4968
Problem: Reading past end of the line when C-indenting.
Solution: Check for NUL.
Files: src/cindent.c, src/testdir/test_cindent.vim
*** ../vim-8.2.4967/src/cindent.c 2022-05-09 20:09:19.278641427 +0100
--- src/cindent.c 2022-05-16 18:03:52.959549075 +0100
***************
*** 89,95 ****
while (vim_isdigit(p[i - 1])) // '\000'
++i;
}
! if (p[i] == '\'') // check for trailing '
{
p += i;
continue;
--- 89,95 ----
while (vim_isdigit(p[i - 1])) // '\000'
++i;
}
! if (p[i - 1] != NUL && p[i] == '\'') // check for trailing '
{
p += i;
continue;
*** ../vim-8.2.4967/src/testdir/test_cindent.vim 2022-04-07 12:39:03.987973874 +0100
--- src/testdir/test_cindent.vim 2022-05-16 17:31:20.790820668 +0100
***************
*** 5319,5324 ****
--- 5319,5331 ----
close!
endfunc
+ " This was reading past the end of the line
+ func Test_cindent_check_funcdecl()
+ new
+ sil norm o0 ('\0 =L
+ bwipe!
+ endfunc
+
func Test_cindent_scopedecls()
new
setl cindent ts=4 sw=4
*** ../vim-8.2.4967/src/version.c 2022-05-16 17:07:37.972022108 +0100
--- src/version.c 2022-05-16 17:33:02.614733901 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4968,
/**/
--
hundred-and-one symptoms of being an internet addict:
216. Your pet rock leaves home.
/// Bram Moolenaar -- Br...@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 ///