summaryrefslogtreecommitdiffstats
path: root/src/cmdhist.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-26 22:36:41 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-26 22:36:41 +0100
commit5ff595d9db2d9a33aa10cc9f18f256826226862f (patch)
tree1abcab2fb32d1084c7d0667490679d5c5941a04b /src/cmdhist.c
parentaf9a6002e0761012cb7108cbfa179a880d3cb49b (diff)
patch 9.0.0284: using static buffer for multiple completion functionsv9.0.0284
Problem: Using static buffer for multiple completion functions. Solution: Use one buffer in expand_T.
Diffstat (limited to 'src/cmdhist.c')
-rw-r--r--src/cmdhist.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmdhist.c b/src/cmdhist.c
index 6256fd91b0..0619e82775 100644
--- a/src/cmdhist.c
+++ b/src/cmdhist.c
@@ -99,15 +99,15 @@ static char *(history_names[]) =
char_u *
get_history_arg(expand_T *xp UNUSED, int idx)
{
- static char_u compl[2] = { NUL, NUL };
- char *short_names = ":=@>?/";
- int short_names_count = (int)STRLEN(short_names);
- int history_name_count = ARRAY_LENGTH(history_names) - 1;
+ char *short_names = ":=@>?/";
+ int short_names_count = (int)STRLEN(short_names);
+ int history_name_count = ARRAY_LENGTH(history_names) - 1;
if (idx < short_names_count)
{
- compl[0] = (char_u)short_names[idx];
- return compl;
+ xp->xp_buf[0] = (char_u)short_names[idx];
+ xp->xp_buf[1] = NUL;
+ return xp->xp_buf;
}
if (idx < short_names_count + history_name_count)
return (char_u *)history_names[idx - short_names_count];