mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(eval): fixup for empty modifier in fnamemodify (#16368)
* fix(eval): fixup for empty modifier in fnamemodify
1dbbaf89bf
erroneously removed a check for empty modifier and a PVS fix.
Restore that check and fix.
Fixes #16367
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
parent
f71be1f87b
commit
a7ad509902
@ -2663,12 +2663,12 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
char buf[NUMBUFLEN];
|
||||
const char *fname = tv_get_string_chk(&argvars[0]);
|
||||
const char *const mods = tv_get_string_buf_chk(&argvars[1], buf);
|
||||
if (fname == NULL) {
|
||||
if (mods == NULL || fname == NULL) {
|
||||
fname = NULL;
|
||||
} else if (mods != NULL && *mods != NUL) {
|
||||
} else {
|
||||
len = strlen(fname);
|
||||
size_t usedlen = 0;
|
||||
if (*mods != NUL) {
|
||||
size_t usedlen = 0;
|
||||
(void)modify_fname((char_u *)mods, false, &usedlen,
|
||||
(char_u **)&fname, &fbuf, &len);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user