mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
Merge pull request #13526 from janlazo/vim-8.1.0839
vim-patch:8.1.{839,1630,2382},8.2.{669,739,1911,2136,2140}
This commit is contained in:
commit
0285fae5ec
@ -2463,7 +2463,7 @@ static void f_fnameescape(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||||
{
|
{
|
||||||
char_u *fbuf = NULL;
|
char_u *fbuf = NULL;
|
||||||
size_t len;
|
size_t len = 0;
|
||||||
char buf[NUMBUFLEN];
|
char buf[NUMBUFLEN];
|
||||||
const char *fname = tv_get_string_chk(&argvars[0]);
|
const char *fname = tv_get_string_chk(&argvars[0]);
|
||||||
const char *const mods = tv_get_string_buf_chk(&argvars[1], buf);
|
const char *const mods = tv_get_string_buf_chk(&argvars[1], buf);
|
||||||
@ -2472,8 +2472,10 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
} else {
|
} else {
|
||||||
len = strlen(fname);
|
len = strlen(fname);
|
||||||
size_t usedlen = 0;
|
size_t usedlen = 0;
|
||||||
(void)modify_fname((char_u *)mods, false, &usedlen,
|
if (mods != NULL && *mods != NUL) {
|
||||||
(char_u **)&fname, &fbuf, &len);
|
(void)modify_fname((char_u *)mods, false, &usedlen,
|
||||||
|
(char_u **)&fname, &fbuf, &len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
|
@ -492,7 +492,7 @@ static inline void tv_list_ref(list_T *const l)
|
|||||||
static inline void tv_list_set_ret(typval_T *const tv, list_T *const l)
|
static inline void tv_list_set_ret(typval_T *const tv, list_T *const l)
|
||||||
REAL_FATTR_ALWAYS_INLINE REAL_FATTR_NONNULL_ARG(1);
|
REAL_FATTR_ALWAYS_INLINE REAL_FATTR_NONNULL_ARG(1);
|
||||||
|
|
||||||
/// Set a list as the return value
|
/// Set a list as the return value. Increments the reference count.
|
||||||
///
|
///
|
||||||
/// @param[out] tv Object to receive the list
|
/// @param[out] tv Object to receive the list
|
||||||
/// @param[in,out] l List to pass to the object
|
/// @param[in,out] l List to pass to the object
|
||||||
|
Loading…
Reference in New Issue
Block a user