forked from aniani/vim
patch 8.2.5016: access before start of text with a put command
Problem: Access before start of text with a put command. Solution: Check the length is more than zero.
This commit is contained in:
@@ -2219,9 +2219,12 @@ error:
|
|||||||
len = STRLEN(y_array[y_size - 1]);
|
len = STRLEN(y_array[y_size - 1]);
|
||||||
col = (colnr_T)len - lendiff;
|
col = (colnr_T)len - lendiff;
|
||||||
if (col > 1)
|
if (col > 1)
|
||||||
curbuf->b_op_end.col = col - 1
|
{
|
||||||
- mb_head_off(y_array[y_size - 1],
|
curbuf->b_op_end.col = col - 1;
|
||||||
|
if (len > 0)
|
||||||
|
curbuf->b_op_end.col -= mb_head_off(y_array[y_size - 1],
|
||||||
y_array[y_size - 1] + len - 1);
|
y_array[y_size - 1] + len - 1);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
curbuf->b_op_end.col = 0;
|
curbuf->b_op_end.col = 0;
|
||||||
|
|
||||||
|
@@ -210,5 +210,14 @@ func Test_multibyte_op_end_mark()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" this was putting a mark before the start of a line
|
||||||
|
func Test_put_empty_register()
|
||||||
|
new
|
||||||
|
norm yy
|
||||||
|
norm [Pi00ggv)s0
|
||||||
|
sil! norm [P
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -734,6 +734,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
5016,
|
||||||
/**/
|
/**/
|
||||||
5015,
|
5015,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user