mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-02 09:13:25 +08:00
Readd ^&1
redirection
This was lost in 35671dd9f094cf8c643c9cf224c27a2b55578937. Even tho we plan to drop caret redirection, while it's there it should fully work. Fixes #6591. (cherry picked from commit 13b470af0756dcdacaeee8a69426e1ac8c26ebbb)
This commit is contained in:
parent
cecb0ebbbc
commit
eea919f97e
@ -412,7 +412,12 @@ maybe_t<pipe_or_redir_t> pipe_or_redir_t::from_string(const wchar_t *buff) {
|
||||
consume(L'^');
|
||||
result.fd = STDERR_FILENO;
|
||||
result.mode = redirection_mode_t::overwrite;
|
||||
if (try_consume(L'^')) result.mode = redirection_mode_t::append;
|
||||
if (try_consume(L'^')) {
|
||||
result.mode = redirection_mode_t::append;
|
||||
} else if (try_consume(L'&')) {
|
||||
// This is a redirection to an fd.
|
||||
result.mode = redirection_mode_t::fd;
|
||||
}
|
||||
if (try_consume(L'?')) result.mode = redirection_mode_t::noclob;
|
||||
break;
|
||||
}
|
||||
|
2
tests/checks/features-nocaret5.fish
Normal file
2
tests/checks/features-nocaret5.fish
Normal file
@ -0,0 +1,2 @@
|
||||
#RUN: %fish --features no-stderr-nocaret -c 'ls /abavojijsdfhdsjhfuihifoisj ^&1'
|
||||
# CHECK: ls: {{.*}}
|
Loading…
x
Reference in New Issue
Block a user