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

fc90d8087a

Co-authored-by: John Marriott <basilisk@internode.on.net>
This commit is contained in:
zeertzjq
2026-02-22 07:03:29 +08:00
parent b3a3028fd9
commit b775c722dd
4 changed files with 7 additions and 7 deletions

View File

@@ -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');
}

View File

@@ -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("<SNR>"));
GA_CONCAT_LITERAL(&line_ga, "<SNR>");
} else {
if (cmod != 0) {
ga_append(&line_ga, K_SPECIAL);

View File

@@ -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);

View File

@@ -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, "..");
}
}
}