0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

patch 9.1.1292: statusline not correctly evaluated

Problem:  statusline not correctly evaluated
          (Peter Kenny, after v9.1.1291)
Solution: revert part of patch v9.1.1291
          (Hirohito Higashi)

fixes: #17095
closes: #17094

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi 2025-04-12 11:28:18 +02:00 committed by Christian Brabandt
parent d82f3cae39
commit c8ce81b0dc
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 18 additions and 5 deletions

View File

@ -4834,14 +4834,25 @@ build_stl_str_hl(
&& evaldepth < MAX_STL_EVAL_DEPTH)
{
size_t parsed_usefmt = (size_t)(block_start - usefmt);
size_t new_fmt_len = (parsed_usefmt
+ STRLEN(str) + STRLEN(s) + 3) * sizeof(char_u);
char_u *new_fmt = (char_u *)alloc(new_fmt_len);
size_t str_length = strlen((const char *)str);
size_t fmt_length = strlen((const char *)s);
size_t new_fmt_len = parsed_usefmt
+ str_length + fmt_length + 3;
char_u *new_fmt = (char_u *)alloc(new_fmt_len * sizeof(char_u));
if (new_fmt != NULL)
{
vim_snprintf((char *)new_fmt, new_fmt_len, "%.*s%s%s%s",
(int)parsed_usefmt, usefmt, str, "%}", s);
char_u *new_fmt_p = new_fmt;
new_fmt_p = (char_u *)memcpy(new_fmt_p, usefmt, parsed_usefmt)
+ parsed_usefmt;
new_fmt_p = (char_u *)memcpy(new_fmt_p , str, str_length)
+ str_length;
new_fmt_p = (char_u *)memcpy(new_fmt_p, "%}", 2) + 2;
new_fmt_p = (char_u *)memcpy(new_fmt_p , s, fmt_length)
+ fmt_length;
*new_fmt_p = 0;
new_fmt_p = NULL;
if (usefmt != fmt)
vim_free(usefmt);

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1292,
/**/
1291,
/**/