From: Christ van Willegen Date: Sun, 30 Mar 2025 13:26:01 +0000 (+0200) Subject: patch 9.1.1263: string length wrong in get_last_inserted_save() X-Git-Tag: v9.1.1263^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=583f5aee96940c29ba17ffb87f1ddf56741b72ba;p=thirdparty%2Fvim.git patch 9.1.1263: string length wrong in get_last_inserted_save() Problem: string length wrong in get_last_inserted_save() (after v9.1.1222) Solution: when removing trailing ESC, also decrease the string length (Christ van Willegen) closes: #16961 Signed-off-by: Christ van Willegen Signed-off-by: Christian Brabandt --- diff --git a/src/edit.c b/src/edit.c index a2a004c124..3fa95cdb05 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3022,7 +3022,7 @@ get_last_insert_save(void) return NULL; if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing ESC - s[insert.length - 1] = NUL; + s[--insert.length] = NUL; return s; } diff --git a/src/version.c b/src/version.c index ec6acb6105..75cbd635dc 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1263, /**/ 1262, /**/