summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-25 13:52:37 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-25 13:52:37 +0000
commit96e7a5928e1e7a350cd6c6d0b9376305190046e7 (patch)
treebdd1d9fdc79e4572cfea70a1c5a96cd7073da0e6
parent0bd8d0563853ab821a018fb9cdd85f674684fe57 (diff)
downloadvim-git-8.2.3674.tar.gz
patch 8.2.3674: when ml_get_buf() fails it messes up IObuffv8.2.3674
Problem: When ml_get_buf() fails it messes up IObuff. Solution: Return a local pointer. (closes #9214)
-rw-r--r--src/memline.c5
-rw-r--r--src/version.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/memline.c b/src/memline.c
index f54a970cc..119861e5d 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -2606,6 +2606,7 @@ ml_get_buf(
bhdr_T *hp;
DATA_BL *dp;
static int recursive = 0;
+ static char_u questions[4];
if (lnum > buf->b_ml.ml_line_count) // invalid line number
{
@@ -2618,9 +2619,9 @@ ml_get_buf(
--recursive;
}
errorret:
- STRCPY(IObuff, "???");
+ STRCPY(questions, "???");
buf->b_ml.ml_line_len = 4;
- return IObuff;
+ return questions;
}
if (lnum <= 0) // pretend line 0 is line 1
lnum = 1;
diff --git a/src/version.c b/src/version.c
index 3f8310373..6d96d4324 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3674,
+/**/
3673,
/**/
3672,