From ace6b7b68d32441de1efa8dd0b6aa7b939761536 Mon Sep 17 00:00:00 2001 From: Moody Liu Date: Wed, 21 Aug 2024 19:24:31 +0100 Subject: [PATCH] mossh: bug fixes --- userspace/programs/mossh/main.cpp | 4 ---- userspace/programs/mossh/parser.cpp | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/userspace/programs/mossh/main.cpp b/userspace/programs/mossh/main.cpp index 1898aff7..c1b66a69 100644 --- a/userspace/programs/mossh/main.cpp +++ b/userspace/programs/mossh/main.cpp @@ -26,16 +26,12 @@ bool execute_line(const std::string &in) { auto line = string_trim(in); - // check if the line ends with an '&' and if so, run it in the background - bool should_wait = true; - // split the programs auto spec = parse_commandline(line); if (!spec) return false; LaunchContext ctx{ std::move(spec) }; - ctx.should_wait = should_wait; return ctx.start(); } diff --git a/userspace/programs/mossh/parser.cpp b/userspace/programs/mossh/parser.cpp index f73d616d..e7a7a940 100644 --- a/userspace/programs/mossh/parser.cpp +++ b/userspace/programs/mossh/parser.cpp @@ -84,7 +84,12 @@ static std::vector lex(const std::string &cmd) while (++data < end) { if (*data == ' ' || *data == '\t' || *data == '\n' || *data == '\r' || *data == '\'' || *data == '"' || *data == '`') + { + // possibly end the double or single quote + if (in_double_quotes && *data == '"') + in_double_quotes = false; break; + } var += *data; }