summaryrefslogtreecommitdiff
path: root/src/netbeans.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-10 18:45:26 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-10 18:45:26 +0100
commitd23a823669d93fb2a570a039173eefe4856ac806 (patch)
tree617130258eae70e3bd7ef7b6da9c494ffee7b572 /src/netbeans.c
parent42443c7d7fecc3a2a72154bb6139b028438617c2 (diff)
downloadvim-git-d23a823669d93fb2a570a039173eefe4856ac806.tar.gz
patch 8.0.1496: clearing a pointer takes two linesv8.0.1496
Problem: Clearing a pointer takes two lines. Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi, closes #2629)
Diffstat (limited to 'src/netbeans.c')
-rw-r--r--src/netbeans.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/netbeans.c b/src/netbeans.c
index 199cfd63c..bc3b8e680 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -580,8 +580,7 @@ nb_free(void)
buf.bufp->b_was_netbeans_file = FALSE;
}
}
- vim_free(buf_list);
- buf_list = NULL;
+ VIM_CLEAR(buf_list);
buf_list_size = 0;
buf_list_used = 0;
@@ -1477,8 +1476,7 @@ nb_do_cmd(
EMSG("E636: invalid buffer identifier in create");
return FAIL;
}
- vim_free(buf->displayname);
- buf->displayname = NULL;
+ VIM_CLEAR(buf->displayname);
netbeansReadFile = 0; /* don't try to open disk file */
do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF, curwin);
@@ -3447,8 +3445,7 @@ print_read_msg(nbbuf_T *buf)
msg_add_lines(c, (long)lnum, nchars);
/* Now display it */
- vim_free(keep_msg);
- keep_msg = NULL;
+ VIM_CLEAR(keep_msg);
msg_scrolled_ign = TRUE;
msg_trunc_attr(IObuff, FALSE, 0);
msg_scrolled_ign = FALSE;
@@ -3475,8 +3472,7 @@ print_save_msg(nbbuf_T *buf, off_T nchars)
msg_add_lines(c, buf->bufp->b_ml.ml_line_count,
buf->bufp->b_orig_size);
- vim_free(keep_msg);
- keep_msg = NULL;
+ VIM_CLEAR(keep_msg);
msg_scrolled_ign = TRUE;
p = msg_trunc_attr(IObuff, FALSE, 0);
if ((msg_scrolled && !need_wait_return) || !buf->initDone)