Shell: Implement escaping quotes in quoted strings

This commit is contained in:
Bananymous 2024-08-24 17:13:50 +03:00
parent 14fdcb892d
commit bec3e8654f
1 changed files with 12 additions and 0 deletions

View File

@ -197,6 +197,18 @@ BAN::Vector<BAN::Vector<BAN::String>> parse_command(BAN::StringView command_view
{
char c = command_view[i];
if (i + 1 < command_view.size() && c == '\\')
{
char next = command_view[i + 1];
if (next == '\'' || next == '"')
{
if (i + 1 < command_view.size())
MUST(current_arg.push_back(next));
i++;
continue;
}
}
switch (state)
{
case State::Normal: