From b775c722dd4f50fd0dae32cd4cbf1af7b02ecf27 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 22 Feb 2026 07:03:29 +0800 Subject: [PATCH] vim-patch:9.2.0041: Not always using GA_CONCAT_LITERAL Problem: Not always using GA_CONCAT_LITERAL with string literals. (after: v9.2.0031) Solution: Use the GA_CONCAT_LITERAL, instead of ga_concat_len. (John Marriott) closes: vim/vim#19468 https://github.com/vim/vim/commit/fc90d8087adc607ee92262f43b8c8c0ec17dbb86 Co-authored-by: John Marriott --- src/nvim/cmdexpand.c | 4 ++-- src/nvim/getchar.c | 2 +- src/nvim/regexp.c | 6 +++--- src/nvim/runtime.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index e7a6390a03..1841424707 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -4059,7 +4059,7 @@ static int copy_substring_from_pos(pos_T *start, pos_T *end, char **match, pos_T ga_concat_len(&ga, start_ptr, (size_t)segment_len); if (!is_single_line) { if (exacttext) { - ga_concat_len(&ga, S_LEN("\\n")); + GA_CONCAT_LITERAL(&ga, "\\n"); } else { ga_append(&ga, '\n'); } @@ -4073,7 +4073,7 @@ static int copy_substring_from_pos(pos_T *start, pos_T *end, char **match, pos_T ga_grow(&ga, linelen + 2); ga_concat_len(&ga, line, (size_t)linelen); if (exacttext) { - ga_concat_len(&ga, S_LEN("\\n")); + GA_CONCAT_LITERAL(&ga, "\\n"); } else { ga_append(&ga, '\n'); } diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 10bf78839d..a82c0092d6 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -3202,7 +3202,7 @@ char *getcmdkeycmd(int promptc, void *cookie, int indent, bool do_concat) emsg(_(e_cmd_mapping_must_end_with_cr_before_second_cmd)); aborted = true; } else if (c1 == K_SNR) { - ga_concat_len(&line_ga, S_LEN("")); + GA_CONCAT_LITERAL(&line_ga, ""); } else { if (cmod != 0) { ga_append(&line_ga, K_SPECIAL); diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 451debf940..f990f79222 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -11587,9 +11587,9 @@ static void nfa_print_state2(FILE *debugf, nfa_state_T *state, garray_T *indent) // grow indent for state->out indent->ga_len -= 1; if (state->out1) { - ga_concat(indent, S_LEN("| ")); + GA_CONCAT_LITERAL(indent, "| "); } else { - ga_concat(indent, S_LEN(" ")); + GA_CONCAT_LITERAL(indent, " "); } ga_append(indent, NUL); @@ -11597,7 +11597,7 @@ static void nfa_print_state2(FILE *debugf, nfa_state_T *state, garray_T *indent) // replace last part of indent for state->out1 indent->ga_len -= 3; - ga_concat(indent, S_LEN(" ")); + GA_CONCAT_LITERAL(indent, " "); ga_append(indent, NUL); nfa_print_state2(debugf, state->out1, indent); diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 72685fe2d9..96b4461e65 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -224,7 +224,7 @@ char *estack_sfile(estack_arg_T which) "[%" PRIdLINENR "]", lnum); } if (idx != exestack.ga_len - 1) { - ga_concat_len(&ga, S_LEN("..")); + GA_CONCAT_LITERAL(&ga, ".."); } } }