undo: Do some refactoring

Specifically refactor u_get_undo_file_name which will be modified to
automatically create undo directory and replace `char_u` with `char` in some of
the related functions.
This commit is contained in:
ZyX
2015-10-29 01:14:01 +03:00
parent 1af15494c2
commit d99941777d
4 changed files with 95 additions and 75 deletions

View File

@@ -16678,10 +16678,11 @@ static void f_undofile(typval_T *argvars, typval_T *rettv)
/* If there is no file name there will be no undo file. */
rettv->vval.v_string = NULL;
} else {
char_u *ffname = (char_u *)FullName_save((char *)fname, FALSE);
char *ffname = FullName_save((char *)fname, false);
if (ffname != NULL)
rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
if (ffname != NULL) {
rettv->vval.v_string = (char_u *)u_get_undo_file_name(ffname, false);
}
xfree(ffname);
}
}