mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.1833: when reading from stdin dup() is called twice
Problem: When reading from stdin dup() is called twice. Solution: Remove the dup() in main.c. (Ken Takata, closes #7110)
This commit is contained in:
parent
aab9fada4a
commit
204ade6bcb
15
src/main.c
15
src/main.c
@ -2704,21 +2704,16 @@ read_stdin(void)
|
|||||||
no_wait_return = TRUE;
|
no_wait_return = TRUE;
|
||||||
i = msg_didany;
|
i = msg_didany;
|
||||||
set_buflisted(TRUE);
|
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;
|
no_wait_return = FALSE;
|
||||||
msg_didany = i;
|
msg_didany = i;
|
||||||
TIME_MSG("reading stdin");
|
TIME_MSG("reading stdin");
|
||||||
|
|
||||||
check_swap_exists_action();
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1833,
|
||||||
/**/
|
/**/
|
||||||
1832,
|
1832,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user