mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 23:48:32 +00:00
Review of the memfile.c API and small refactorings
- Create `mf_free_fnames()` that frees and nullifies `mf_[f]fname` - Create `mf_set_fnames()` to set the `mf_fname` and the `mf_ffname` altoghether - Have `mf_do_open` return a bool to indicate success so that calles don't have to check `memfile_T::mf_fd` (file descriptor) - Inline `mf_write_block`
This commit is contained in:
@@ -426,10 +426,8 @@ void ml_setname(buf_T *buf)
|
||||
/* try to rename the swap file */
|
||||
if (vim_rename(mfp->mf_fname, fname) == 0) {
|
||||
success = TRUE;
|
||||
xfree(mfp->mf_fname);
|
||||
mfp->mf_fname = fname;
|
||||
xfree(mfp->mf_ffname);
|
||||
mf_set_ffname(mfp);
|
||||
mf_free_fnames(mfp);
|
||||
mf_set_fnames(mfp, fname);
|
||||
ml_upd_block0(buf, UB_SAME_DIR);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user