diff --git a/src/builtin.cpp b/src/builtin.cpp index 74a327d5f..fee008cd2 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -164,7 +164,7 @@ void builtin_print_help(parser_t &parser, io_streams_t &streams, const wchar_t * if (error_message) { cmd.append(escape_string(*error_message, ESCAPE_ALL)); // If it's an error, redirect the output of __fish_print_help to stderr - ios.push_back(std::make_shared(STDOUT_FILENO, STDERR_FILENO, false)); + ios.push_back(std::make_shared(STDOUT_FILENO, STDERR_FILENO)); } parser.eval(cmd, ios, TOP); // ignore the exit status of __fish_print_help diff --git a/src/exec.cpp b/src/exec.cpp index 011fcf240..a7a0f214c 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -403,14 +403,12 @@ static bool exec_internal_builtin_proc(parser_t &parser, const std::shared_ptrio_mode) { case io_mode_t::fd: { const io_fd_t *in_fd = static_cast(in.get()); - // Ignore user-supplied fd redirections from an fd other than the + // Ignore fd redirections from an fd other than the // standard ones. e.g. in source <&3 don't actually read from fd 3, // 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. Non-user supplied fd - // redirections come about through transmogrification, and we need - // to respect those here. - if (!in_fd->user_supplied || (in_fd->old_fd >= 0 && in_fd->old_fd < 3)) { + // 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; } break; diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index b78898bfc..55cf42eae 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -2460,7 +2460,7 @@ static void test_dup2s() { using std::make_shared; io_chain_t chain; chain.push_back(make_shared(17)); - chain.push_back(make_shared(3, 19, true)); + chain.push_back(make_shared(3, 19)); auto list = dup2_list_t::resolve_chain(chain); do_test(list.has_value()); do_test(list->get_actions().size() == 2); @@ -2479,10 +2479,10 @@ static void test_dup2s_fd_for_target_fd() { io_chain_t chain; // note io_fd_t params are backwards from dup2. chain.push_back(make_shared(10)); - chain.push_back(make_shared(9, 10, true)); - chain.push_back(make_shared(5, 8, true)); - chain.push_back(make_shared(1, 4, true)); - chain.push_back(make_shared(3, 5, true)); + chain.push_back(make_shared(9, 10)); + chain.push_back(make_shared(5, 8)); + chain.push_back(make_shared(1, 4)); + chain.push_back(make_shared(3, 5)); auto list = dup2_list_t::resolve_chain(chain); do_test(list.has_value()); diff --git a/src/io.cpp b/src/io.cpp index ca8648d7c..83240c19a 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -248,8 +248,7 @@ bool io_chain_t::append_from_specs(const redirection_spec_list_t &specs, const w auto target_fd = spec.get_target_as_fd(); assert(target_fd.has_value() && "fd redirection should have been validated already"); - this->push_back( - make_unique(spec.fd, *target_fd, true /* user supplied */)); + this->push_back(make_unique(spec.fd, *target_fd)); } break; } diff --git a/src/io.h b/src/io.h index 6f569f08d..42a7edd21 100644 --- a/src/io.h +++ b/src/io.h @@ -200,17 +200,11 @@ class io_fd_t : public io_data_t { /// fd to redirect specified fd to. For example, in 2>&1, old_fd is 1, and io_data_t::fd is 2. const int old_fd; - /// Whether this redirection was supplied by a script. For example, 'cmd <&3' would have - /// user_supplied set to true. But a redirection that comes about through transmogrification - /// would not. - const bool user_supplied; - void print() const override; ~io_fd_t() override; - io_fd_t(int f, int old, bool us) - : io_data_t(io_mode_t::fd, f), old_fd(old), user_supplied(us) {} + io_fd_t(int f, int old) : io_data_t(io_mode_t::fd, f), old_fd(old) {} }; /// Represents a redirection to or from an opened file.