mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3674: when ml_get_buf() fails it messes up IObuff
Problem: When ml_get_buf() fails it messes up IObuff. Solution: Return a local pointer. (closes #9214)
This commit is contained in:
parent
0bd8d05638
commit
96e7a5928e
@ -2606,6 +2606,7 @@ ml_get_buf(
|
|||||||
bhdr_T *hp;
|
bhdr_T *hp;
|
||||||
DATA_BL *dp;
|
DATA_BL *dp;
|
||||||
static int recursive = 0;
|
static int recursive = 0;
|
||||||
|
static char_u questions[4];
|
||||||
|
|
||||||
if (lnum > buf->b_ml.ml_line_count) // invalid line number
|
if (lnum > buf->b_ml.ml_line_count) // invalid line number
|
||||||
{
|
{
|
||||||
@ -2618,9 +2619,9 @@ ml_get_buf(
|
|||||||
--recursive;
|
--recursive;
|
||||||
}
|
}
|
||||||
errorret:
|
errorret:
|
||||||
STRCPY(IObuff, "???");
|
STRCPY(questions, "???");
|
||||||
buf->b_ml.ml_line_len = 4;
|
buf->b_ml.ml_line_len = 4;
|
||||||
return IObuff;
|
return questions;
|
||||||
}
|
}
|
||||||
if (lnum <= 0) // pretend line 0 is line 1
|
if (lnum <= 0) // pretend line 0 is line 1
|
||||||
lnum = 1;
|
lnum = 1;
|
||||||
|
@ -757,6 +757,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 */
|
||||||
|
/**/
|
||||||
|
3674,
|
||||||
/**/
|
/**/
|
||||||
3673,
|
3673,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user