Mercurial > vim
diff src/channel.c @ 13244:ac42c4b11dbc v8.0.1496
patch 8.0.1496: clearing a pointer takes two lines
commit https://github.com/vim/vim/commit/d23a823669d93fb2a570a039173eefe4856ac806
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 10 18:45:26 2018 +0100
patch 8.0.1496: clearing a pointer takes two lines
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 10 Feb 2018 19:00:07 +0100 |
parents | 808625d4b71b |
children | a69636c63103 |
line wrap: on
line diff
--- a/src/channel.c +++ b/src/channel.c @@ -317,8 +317,8 @@ channel_still_useful(channel_T *channel) /* If there is no callback then nobody can get readahead. If the fd is * closed and there is no readahead then the callback won't be called. */ has_sock_msg = channel->ch_part[PART_SOCK].ch_fd != INVALID_FD - || channel->ch_part[PART_SOCK].ch_head.rq_next != NULL - || channel->ch_part[PART_SOCK].ch_json_head.jq_next != NULL; + || channel->ch_part[PART_SOCK].ch_head.rq_next != NULL + || channel->ch_part[PART_SOCK].ch_json_head.jq_next != NULL; has_out_msg = channel->ch_part[PART_OUT].ch_fd != INVALID_FD || channel->ch_part[PART_OUT].ch_head.rq_next != NULL || channel->ch_part[PART_OUT].ch_json_head.jq_next != NULL; @@ -2978,8 +2978,7 @@ channel_clear_one(channel_T *channel, ch channel_clear(channel_T *channel) { ch_log(channel, "Clearing channel"); - vim_free(channel->ch_hostname); - channel->ch_hostname = NULL; + VIM_CLEAR(channel->ch_hostname); channel_clear_one(channel, PART_SOCK); channel_clear_one(channel, PART_OUT); channel_clear_one(channel, PART_ERR);