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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220516170652.008131C088A%40moolenaar.net.

Raspunde prin e-mail lui