patch 9.1.1193: Unnecessary use of STRCAT() in au_event_disable()

Problem:  Unnecessary use of STRCAT() in au_event_disable().  STRCAT()
          seeks to the end of new_ei, but here the end is already known.
Solution: Use STRCPY() and add p_ei_len to new_ei.  Also fix a typo in a
          comment.  Add a test that 'eventignore' works in :argdo
          (zeertzjq).

closes: #16844

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-03-10 21:15:19 +01:00
committed by Christian Brabandt
parent 835bc014c0
commit 969e11a18b
4 changed files with 29 additions and 2 deletions

View File

@ -870,7 +870,7 @@ au_event_disable(char *what)
if (*what == ',' && *p_ei == NUL)
STRCPY(new_ei, what + 1);
else
STRCAT(new_ei, what);
STRCPY(new_ei + p_ei_len, what);
set_string_option_direct((char_u *)"ei", -1, new_ei,
OPT_FREE, SID_NONE);
vim_free(new_ei);