mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
Switch io_file_t to store an fd, not a path
Prior to this fix, a file redirection was turned into an io_file_t. This is annoying because every place where we want to apply the redirection, we might fail due to open() failing. Switch to opening the file at the point we resolve the redirection spec. This will simplify a lot of code.
This commit is contained in:
@@ -2479,15 +2479,6 @@ static void test_dup2s() {
|
||||
auto act2 = list->get_actions().at(1);
|
||||
do_test(act2.src == 19);
|
||||
do_test(act2.target == 3);
|
||||
|
||||
// Invalid files should fail to open.
|
||||
// Suppress the debug() message.
|
||||
int saved_debug_level = debug_level;
|
||||
debug_level = -1;
|
||||
chain.push_back(make_shared<io_file_t>(2, L"/definitely/not/a/valid/path/for/this/test", 0666));
|
||||
list = dup2_list_t::resolve_chain(chain);
|
||||
do_test(!list.has_value());
|
||||
debug_level = saved_debug_level;
|
||||
}
|
||||
|
||||
static void test_dup2s_fd_for_target_fd() {
|
||||
|
||||
Reference in New Issue
Block a user