mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
vim-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 vim/vim#9214)
96e7a5928e
This commit is contained in:
@@ -1834,6 +1834,7 @@ char_u *ml_get_buf(buf_T *buf, linenr_T lnum, bool will_change)
|
|||||||
DATA_BL *dp;
|
DATA_BL *dp;
|
||||||
char_u *ptr;
|
char_u *ptr;
|
||||||
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
|
||||||
if (recursive == 0) {
|
if (recursive == 0) {
|
||||||
@@ -1844,8 +1845,8 @@ char_u *ml_get_buf(buf_T *buf, linenr_T lnum, bool will_change)
|
|||||||
recursive--;
|
recursive--;
|
||||||
}
|
}
|
||||||
errorret:
|
errorret:
|
||||||
STRCPY(IObuff, "???");
|
STRCPY(questions, "???");
|
||||||
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;
|
||||||
|
Reference in New Issue
Block a user