mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 14:28:18 +00:00
Replace mch_rename and vim_rename with libuv
This commit is contained in:
13
src/eval.c
13
src/eval.c
@@ -12329,13 +12329,14 @@ static void f_remove(typval_T *argvars, typval_T *rettv)
|
||||
*/
|
||||
static void f_rename(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
if (check_restricted() || check_secure())
|
||||
if (check_restricted() || check_secure()) {
|
||||
rettv->vval.v_number = -1;
|
||||
else
|
||||
rettv->vval.v_number = vim_rename(get_tv_string(&argvars[0]),
|
||||
get_tv_string_buf(&argvars[1], buf));
|
||||
} else {
|
||||
char_u buf[NUMBUFLEN];
|
||||
char_u *from = get_tv_string(&argvars[0]);
|
||||
char_u *to = get_tv_string_buf(&argvars[1], buf);
|
||||
rettv->vval.v_number = os_rename(from, to) == OK ? 0 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user