]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2110: cannot use ":shell" when reading from stdin v8.2.2110
authorBram Moolenaar <Bram@vim.org>
Tue, 8 Dec 2020 18:36:21 +0000 (19:36 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 8 Dec 2020 18:36:21 +0000 (19:36 +0100)
Problem:    Cannot use ":shell" when reading from stdin. (Gary Johnson)
Solution:   Revert patch 8.2.1833.

src/main.c
src/version.c

index 1b7811a6707d93a72f068433d2e24773bdabe377..6c591b0a9f58a96337213b01248f11be9d65eeb5 100644 (file)
@@ -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
 }
 
 /*
index 5b4fa3951a4a8a41bcf2c73540bccf0673e27dee..6580dbd831ba89515e16461f8789ecaaed9b3175 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2110,
 /**/
     2109,
 /**/