Replace mch_rename and vim_rename with libuv

This commit is contained in:
Hinidu
2014-04-01 23:27:39 +03:00
committed by Thiago de Arruda
parent 86b6f1ccff
commit a3ff83ce7e
8 changed files with 88 additions and 197 deletions

View File

@@ -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;
}
}
/*