mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-27 01:50:24 +00:00
Shell: Consume the username when parsing '~user'
Otherwise it will stay there and be parsed as a juxtaposition. Fixes #5798.
This commit is contained in:
parent
f59d58cb76
commit
125be2923c
Notes:
sideshowbarker
2024-07-18 21:21:09 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/125be2923c2 Pull-request: https://github.com/SerenityOS/serenity/pull/5800 Issue: https://github.com/SerenityOS/serenity/issues/5798
1 changed files with 4 additions and 0 deletions
|
@ -1686,7 +1686,11 @@ RefPtr<AST::Node> Parser::parse_bareword()
|
|||
restore_to(rule_start->offset, rule_start->line);
|
||||
auto ch = consume();
|
||||
VERIFY(ch == '~');
|
||||
auto username_length = username.length();
|
||||
tilde = create<AST::Tilde>(move(username));
|
||||
// Consume the username (if any)
|
||||
for (size_t i = 0; i < username_length; ++i)
|
||||
consume();
|
||||
}
|
||||
|
||||
if (string.is_empty())
|
||||
|
|
Loading…
Reference in a new issue