aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-05-22 01:02:26 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-05-25 10:07:05 +0200
commitae846b41dfed16446be6469cb01f12f1eb1fa534 (patch)
tree2851845f2faf61d5945cb4f1d8761316201a6246 /src/nvim/quickfix.c
parenta9d7ec4587d8eb20f12ebecc427ad818fb0e4971 (diff)
downloadrneovim-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/quickfix.c')
-rw-r--r--src/nvim/quickfix.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 550f742106..8036d3e3bc 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -848,8 +848,7 @@ qf_init_ext(
int status;
// Do not used the cached buffer, it may have been wiped out.
- xfree(qf_last_bufname);
- qf_last_bufname = NULL;
+ XFREE_CLEAR(qf_last_bufname);
memset(&state, 0, sizeof(state));
memset(&fields, 0, sizeof(fields));
@@ -894,8 +893,7 @@ qf_init_ext(
// parsed values.
if (last_efm == NULL || (STRCMP(last_efm, efm) != 0)) {
// free the previously parsed data
- xfree(last_efm);
- last_efm = NULL;
+ XFREE_CLEAR(last_efm);
free_efm_list(&fmt_first);
// parse the current 'efm'
@@ -1019,8 +1017,7 @@ qf_init_end:
/// Prepends ':' to the title.
static void qf_store_title(qf_info_T *qi, int qf_idx, char_u *title)
{
- xfree(qi->qf_lists[qf_idx].qf_title);
- qi->qf_lists[qf_idx].qf_title = NULL;
+ XFREE_CLEAR(qi->qf_lists[qf_idx].qf_title);
if (title != NULL) {
size_t len = STRLEN(title) + 1;
@@ -2754,8 +2751,7 @@ static void qf_free(qf_info_T *qi, int idx)
qf_list_T *qfl = &qi->qf_lists[idx];
qf_free_items(qi, idx);
- xfree(qfl->qf_title);
- qfl->qf_title = NULL;
+ XFREE_CLEAR(qfl->qf_title);
tv_free(qfl->qf_ctx);
qfl->qf_ctx = NULL;
qfl->qf_id = 0;