Mirror of the Vim source from https://github.com/vim/vim
修订版 | 9f4648953f1ab203d9da6293b03fbb4e62436feb (tree) |
---|---|
时间 | 2020-01-12 22:00:04 |
作者 | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 8.2.0112: illegal memory access when using 'cindent'
Commit: https://github.com/vim/vim/commit/02ad46394e8f887b60fda994f8a5da2ac1937b23
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 12 13:48:18 2020 +0100
@@ -582,6 +582,8 @@ | ||
582 | 582 | for (s += 4; *s; ++s) |
583 | 583 | { |
584 | 584 | s = cin_skipcomment(s); |
585 | + if (*s == NUL) | |
586 | + break; | |
585 | 587 | if (*s == ':') |
586 | 588 | { |
587 | 589 | if (s[1] == ':') // skip over "::" for C++ |
@@ -5251,4 +5251,13 @@ | ||
5251 | 5251 | enew! | close |
5252 | 5252 | endfunc |
5253 | 5253 | |
5254 | +" this was going beyond the end of the line. | |
5255 | +func Test_cindent_case() | |
5256 | + new | |
5257 | + call setline(1, "case x: // x") | |
5258 | + set cindent | |
5259 | + norm! f:a: | |
5260 | + bwipe! | |
5261 | +endfunc | |
5262 | + | |
5254 | 5263 | " vim: shiftwidth=2 sts=2 expandtab |
@@ -743,6 +743,8 @@ | ||
743 | 743 | static int included_patches[] = |
744 | 744 | { /* Add new patch number below this line */ |
745 | 745 | /**/ |
746 | + 112, | |
747 | +/**/ | |
746 | 748 | 111, |
747 | 749 | /**/ |
748 | 750 | 110, |