Patch 8.2.4233

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 27, 2022, 2:27:53 PM1/27/22
to vim...@googlegroups.com

Patch 8.2.4233
Problem: Crash when recording and using Select mode.
Solution: When deleting the last recorded character check there is something
to delete.
Files: src/getchar.c, src/testdir/test_registers.vim


*** ../vim-8.2.4232/src/getchar.c 2022-01-19 22:51:44.225691562 +0000
--- src/getchar.c 2022-01-27 19:22:35.118697355 +0000
***************
*** 252,259 ****
static void
delete_buff_tail(buffheader_T *buf, int slen)
{
! int len = (int)STRLEN(buf->bh_curr->b_str);

if (len >= slen)
{
buf->bh_curr->b_str[len - slen] = NUL;
--- 252,262 ----
static void
delete_buff_tail(buffheader_T *buf, int slen)
{
! int len;

+ if (buf->bh_curr == NULL || buf->bh_curr->b_str == NULL)
+ return; // nothing to delete
+ len = (int)STRLEN(buf->bh_curr->b_str);
if (len >= slen)
{
buf->bh_curr->b_str[len - slen] = NUL;
*** ../vim-8.2.4232/src/testdir/test_registers.vim 2022-01-03 13:47:45.960911768 +0000
--- src/testdir/test_registers.vim 2022-01-27 19:25:26.704095927 +0000
***************
*** 739,744 ****
--- 739,753 ----
bwipe!
endfunc

+ func Test_record_in_select_mode()
+ new
+ call setline(1, 'text')
+ sil norm q0 0
+ sil norm q
+ call assert_equal('0ext', getline(1))
+ bwipe!
+ endfunc
+
" Make sure that y_append is correctly reset
" and the previous register is working as expected
func Test_register_y_append_reset()
*** ../vim-8.2.4232/src/version.c 2022-01-27 17:37:37.759862584 +0000
--- src/version.c 2022-01-27 19:25:52.735702803 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4233,
/**/

--
A fool must search for a greater fool to find admiration.

/// 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 ///
Reply all
Reply to author
Forward
0 new messages