diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-22 01:02:26 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-05-25 10:07:05 +0200 |
commit | ae846b41dfed16446be6469cb01f12f1eb1fa534 (patch) | |
tree | 2851845f2faf61d5945cb4f1d8761316201a6246 /src/nvim/memline.c | |
parent | a9d7ec4587d8eb20f12ebecc427ad818fb0e4971 (diff) | |
download | rneovim-ae846b41dfed16446be6469cb01f12f1eb1fa534.tar.gz rneovim-ae846b41dfed16446be6469cb01f12f1eb1fa534.tar.bz2 rneovim-ae846b41dfed16446be6469cb01f12f1eb1fa534.zip |
vim-patch:8.0.1496: VIM_CLEAR()
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
vim-patch:8.0.1481
Diffstat (limited to 'src/nvim/memline.c')
-rw-r--r-- | src/nvim/memline.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index a071314453..c0a47054cc 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -563,8 +563,7 @@ void ml_close(buf_T *buf, int del_file) if (buf->b_ml.ml_line_lnum != 0 && (buf->b_ml.ml_flags & ML_LINE_DIRTY)) xfree(buf->b_ml.ml_line_ptr); xfree(buf->b_ml.ml_stack); - xfree(buf->b_ml.ml_chunksize); - buf->b_ml.ml_chunksize = NULL; + XFREE_CLEAR(buf->b_ml.ml_chunksize); buf->b_ml.ml_mfp = NULL; /* Reset the "recovered" flag, give the ATTENTION prompt the next time @@ -3344,8 +3343,7 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname, if (fname == NULL) /* must be out of memory */ break; if ((n = strlen(fname)) == 0) { /* safety check */ - xfree(fname); - fname = NULL; + XFREE_CLEAR(fname); break; } // check if the swapfile already exists @@ -3541,8 +3539,7 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname, if (fname[n - 1] == 'a') { /* ".s?a" */ if (fname[n - 2] == 'a') { /* ".saa": tried enough, give up */ EMSG(_("E326: Too many swap files found")); - xfree(fname); - fname = NULL; + XFREE_CLEAR(fname); break; } --fname[n - 2]; /* ".svz", ".suz", etc. */ |