mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
parent
c6e79bd53a
commit
aee99b05a6
Notes:
sideshowbarker
2024-07-19 13:56:58 +09:00
Author: https://github.com/rburchell
Commit: aee99b05a6
Pull-request: https://github.com/SerenityOS/serenity/pull/96
3 changed files with 72 additions and 37 deletions
|
@ -60,7 +60,9 @@ Vector<Subcommand> Parser::parse()
|
|||
if (ch == '>') {
|
||||
commit_token();
|
||||
begin_redirect_write(STDOUT_FILENO);
|
||||
m_state = State::InRedirectionPath;
|
||||
|
||||
// Search for another > for append.
|
||||
m_state = State::InWriteAppendOrRedirectionPath;
|
||||
break;
|
||||
}
|
||||
if (ch == '<') {
|
||||
|
@ -79,6 +81,18 @@ Vector<Subcommand> Parser::parse()
|
|||
}
|
||||
m_token.append(ch);
|
||||
break;
|
||||
case State::InWriteAppendOrRedirectionPath:
|
||||
if (ch == '>') {
|
||||
commit_token();
|
||||
m_state = State::InRedirectionPath;
|
||||
ASSERT(m_redirections.size());
|
||||
m_redirections[m_redirections.size() - 1].type = Redirection::FileWriteAppend;
|
||||
break;
|
||||
}
|
||||
|
||||
// Not another > means that it's probably a path.
|
||||
m_state = InRedirectionPath;
|
||||
[[fallthrough]];
|
||||
case State::InRedirectionPath:
|
||||
if (ch == '<') {
|
||||
commit_token();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue