io_data_t to store the source_fd directly

Now that all io_data_ts know their source fd, just store it directly in
the base class. This will simplify some uses of io_data_t.
This commit is contained in:
ridiculousfish
2019-12-29 15:14:08 -08:00
parent 5d55004841
commit 0af5608ce8
4 changed files with 21 additions and 16 deletions

View File

@@ -392,8 +392,8 @@ static bool exec_internal_builtin_proc(parser_t &parser, const std::shared_ptr<j
// which is internal to fish. We still respect this redirection in
// that we pass it on as a block IO to the code that source runs,
// and therefore this is not an error.
if (in_fd->old_fd >= 0 && in_fd->old_fd < 3) {
local_builtin_stdin = in_fd->old_fd;
if (in_fd->source_fd >= 0 && in_fd->source_fd < 3) {
local_builtin_stdin = in_fd->source_fd;
}
break;
}