aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-05-04 09:37:25 -0400
committerGitHub <noreply@github.com>2021-05-04 09:37:25 -0400
commitc2624b87cb6b5ba1fe811a005cc3c0977a864633 (patch)
treed0cf35464e4d0bcc304e49a60944702604299527
parent3fc71ea228f6fef058ebcb9c08c2ada32a705129 (diff)
parentc9567704b70fb1d6aba20ef909501b5ac0277d3d (diff)
downloadrneovim-c2624b87cb6b5ba1fe811a005cc3c0977a864633.tar.gz
rneovim-c2624b87cb6b5ba1fe811a005cc3c0977a864633.tar.bz2
rneovim-c2624b87cb6b5ba1fe811a005cc3c0977a864633.zip
Merge pull request #14486 from Sh3Rm4n/fix_get_str_line
get_str_line: Replace grow_array usage
-rw-r--r--src/nvim/ex_cmds2.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 317ca465e1..7f28c001f9 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -2720,12 +2720,9 @@ static char_u *get_str_line(int c, void *cookie, int indent, bool do_concat)
i++;
}
size_t line_length = i - p->offset;
- garray_T ga;
- ga_init(&ga, (int)sizeof(char_u), (int)line_length);
- ga_concat_len(&ga, (char *)p->buf + p->offset, line_length);
- ga_append(&ga, '\0');
+ char_u *buf = xmemdupz(p->buf + p->offset, line_length);
p->offset = i + 1;
- return ga.ga_data;
+ return buf;
}
static int source_using_linegetter(void *cookie,