patch 9.1.1263: string length wrong in get_last_inserted_save()
Commit:
https://github.com/vim/vim/commit/583f5aee96940c29ba17ffb87f1ddf56741b72ba
Author: Christ van Willegen <[email protected]>
Date: Sun Mar 30 15:26:01 2025 +0200
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/edit.c b/src/edit.c
index a2a004c12..3fa95cdb0 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 ec6acb610..75cbd635d 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,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1tysjl-007QdY-9D%40256bit.org.