Shell: Implement escaping quotes in quoted strings
This commit is contained in:
parent
14fdcb892d
commit
bec3e8654f
|
@ -197,6 +197,18 @@ BAN::Vector<BAN::Vector<BAN::String>> parse_command(BAN::StringView command_view
|
||||||
{
|
{
|
||||||
char c = command_view[i];
|
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)
|
switch (state)
|
||||||
{
|
{
|
||||||
case State::Normal:
|
case State::Normal:
|
||||||
|
|
Loading…
Reference in New Issue