summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-08 19:36:21 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-08 19:36:21 +0100
commit8e1cbb55c389bdc4eade7a67309d5042fbcdca7d (patch)
treeeb160bcb6afefb093f669abdc433b43b0d02dbb0 /src/main.c
parent8a3da6a368ca7e761939366e355528bccb6dffa3 (diff)
downloadvim-git-8e1cbb55c389bdc4eade7a67309d5042fbcdca7d.tar.gz
patch 8.2.2110: cannot use ":shell" when reading from stdinv8.2.2110
Problem: Cannot use ":shell" when reading from stdin. (Gary Johnson) Solution: Revert patch 8.2.1833.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 1b7811a67..6c591b0a9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2709,7 +2709,6 @@ read_stdin(void)
set_buflisted(TRUE);
// 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;
@@ -2717,6 +2716,14 @@ read_stdin(void)
TIME_MSG("reading stdin");
check_swap_exists_action();
+
+#if !(defined(AMIGA) || defined(MACOS_X))
+ // Dup stdin from stderr to read commands from, so that shell commands
+ // work.
+ // TODO: why is this needed, even though readfile() has done this?
+ close(0);
+ vim_ignored = dup(2);
+#endif
}
/*