mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-31 23:28:45 +00:00
Apply code review from #6806
This commit is contained in:
parent
3a47db74b0
commit
844ae48dc0
1 changed files with 5 additions and 5 deletions
|
@ -27,6 +27,9 @@ int builtin_eval(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||||
new_cmd += argv[i];
|
new_cmd += argv[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy the full io chain; we may append bufferfills.
|
||||||
|
io_chain_t ios = *streams.io_chain;
|
||||||
|
|
||||||
// If stdout is piped, then its output must go to the streams, not to the io_chain in our
|
// If stdout is piped, then its output must go to the streams, not to the io_chain in our
|
||||||
// streams, because the pipe may be intended to be consumed by a process which
|
// streams, because the pipe may be intended to be consumed by a process which
|
||||||
// is not yet launched (#6806). If stdout is NOT redirected, it must see the tty (#6955). So
|
// is not yet launched (#6806). If stdout is NOT redirected, it must see the tty (#6955). So
|
||||||
|
@ -41,6 +44,7 @@ int builtin_eval(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||||
// We were unable to create a pipe, probably fd exhaustion.
|
// We were unable to create a pipe, probably fd exhaustion.
|
||||||
return STATUS_CMD_ERROR;
|
return STATUS_CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
ios.push_back(stdout_fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Of course the same applies to stderr.
|
// Of course the same applies to stderr.
|
||||||
|
@ -51,13 +55,9 @@ int builtin_eval(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||||
if (!stderr_fill) {
|
if (!stderr_fill) {
|
||||||
return STATUS_CMD_ERROR;
|
return STATUS_CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
ios.push_back(stderr_fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct the full io chain, perhaps with our bufferfills appended.
|
|
||||||
io_chain_t ios = *streams.io_chain;
|
|
||||||
if (stdout_fill) ios.push_back(stdout_fill);
|
|
||||||
if (stderr_fill) ios.push_back(stderr_fill);
|
|
||||||
|
|
||||||
int status = STATUS_CMD_OK;
|
int status = STATUS_CMD_OK;
|
||||||
auto res = parser.eval(new_cmd, ios, streams.parent_pgid);
|
auto res = parser.eval(new_cmd, ios, streams.parent_pgid);
|
||||||
if (res.was_empty) {
|
if (res.was_empty) {
|
||||||
|
|
Loading…
Reference in a new issue