aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-09-16 22:57:34 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2021-07-06 19:07:11 +0200
commit55a2c513aafb386c01259fca711b2e0f9b85e359 (patch)
treee9775da5a45147c4706ad468af925e0a53bcdcb3 /src/nvim/main.c
parentdf33f30e8882b2bf692253d63f73fb602a13f888 (diff)
downloadrneovim-55a2c513aafb386c01259fca711b2e0f9b85e359.tar.gz
rneovim-55a2c513aafb386c01259fca711b2e0f9b85e359.tar.bz2
rneovim-55a2c513aafb386c01259fca711b2e0f9b85e359.zip
buffer: don't rely on curbuf in BUFEMPTY
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 2cb562b558..9bccca85ee 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -1444,11 +1444,9 @@ static void read_stdin(void)
no_wait_return = true;
int save_msg_didany = msg_didany;
set_buflisted(true);
-
// Create memfile and read from stdin.
(void)open_buffer(true, NULL, 0);
-
- if (BUFEMPTY() && curbuf->b_next != NULL) {
+ if (BUFEMPTY(curbuf) && curbuf->b_next != NULL) {
// stdin was empty, go to buffer 2 (e.g. "echo file1 | xargs nvim"). #8561
do_cmdline_cmd("silent! bnext");
// Delete the empty stdin buffer.