# HG changeset patch # User Bram Moolenaar # Date 1637848806 -3600 # Node ID 2815b25993fb527e1b5fc5ed62ce8d7fb3c5d48b # Parent 4bfa37787ac9c81c46a9ae39471b815476650679 patch 8.2.3674: when ml_get_buf() fails it messes up IObuff Commit: https://github.com/vim/vim/commit/96e7a5928e1e7a350cd6c6d0b9376305190046e7 Author: Bram Moolenaar Date: Thu Nov 25 13:52:37 2021 +0000 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 https://github.com/vim/vim/issues/9214) diff --git a/src/memline.c b/src/memline.c --- 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 --- 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,