summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-11 14:58:46 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-11 14:58:46 +0200
commit204ade6bcb85f48f56e52e040d1ebf40548d92be (patch)
tree78cd92f369b078b79881d89201cac75a3e586db6
parentaab9fada4a9b9725ff42dffe9c7daff20f0fd85f (diff)
downloadvim-git-204ade6bcb85f48f56e52e040d1ebf40548d92be.tar.gz
patch 8.2.1833: when reading from stdin dup() is called twicev8.2.1833
Problem: When reading from stdin dup() is called twice. Solution: Remove the dup() in main.c. (Ken Takata, closes #7110)
-rw-r--r--src/main.c15
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index c87fdbfb5..53b871977 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2704,21 +2704,16 @@ read_stdin(void)
no_wait_return = TRUE;
i = msg_didany;
set_buflisted(TRUE);
- (void)open_buffer(TRUE, NULL, 0); // create memfile and read file
+
+ // Create memfile and read from stdin.
+ // This will also dup stdin from stderr to read commands from.
+ (void)open_buffer(TRUE, NULL, 0);
+
no_wait_return = FALSE;
msg_didany = i;
TIME_MSG("reading stdin");
check_swap_exists_action();
-#if !(defined(AMIGA) || defined(MACOS_X))
- /*
- * Close stdin and dup it from stderr. Required for GPM to work
- * properly, and for running external commands.
- * Is there any other system that cannot do this?
- */
- close(0);
- vim_ignored = dup(2);
-#endif
}
/*
diff --git a/src/version.c b/src/version.c
index 6368b5e5b..43613450c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1833,
+/**/
1832,
/**/
1831,