Browse Source

Shell: Allow appending empty string literals

Otherwise, we just silently drop arguments that are empty strings.
Tim Schumacher 2 years ago
parent
commit
46c22ee49d
1 changed files with 0 additions and 6 deletions
  1. 0 6
      Userland/Shell/PosixParser.cpp

+ 0 - 6
Userland/Shell/PosixParser.cpp

@@ -1435,9 +1435,6 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_word()
     };
 
     auto append_string_literal = [&](StringView string) -> ErrorOr<void> {
-        if (string.is_empty())
-            return {};
-
         auto node = make_ref_counted<AST::StringLiteral>(
             token.position.value_or(empty_position()),
             TRY(String::from_utf8(string)),
@@ -1457,9 +1454,6 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_word()
     };
 
     auto append_string_part = [&](StringView string) -> ErrorOr<void> {
-        if (string.is_empty())
-            return {};
-
         auto node = make_ref_counted<AST::StringLiteral>(
             token.position.value_or(empty_position()),
             TRY(String::from_utf8(string)),