Explorar o código

Shell: Allow appending empty string literals

Otherwise, we just silently drop arguments that are empty strings.
Tim Schumacher %!s(int64=2) %!d(string=hai) anos
pai
achega
46c22ee49d
Modificáronse 1 ficheiros con 0 adicións e 6 borrados
  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)),