From 46c22ee49d288806079059ae1c810c2ad2de724c Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 23 Mar 2023 14:01:42 +0100 Subject: [PATCH] Shell: Allow appending empty string literals Otherwise, we just silently drop arguments that are empty strings. --- Userland/Shell/PosixParser.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Userland/Shell/PosixParser.cpp b/Userland/Shell/PosixParser.cpp index b3a8bc9177..359c12d1f8 100644 --- a/Userland/Shell/PosixParser.cpp +++ b/Userland/Shell/PosixParser.cpp @@ -1435,9 +1435,6 @@ ErrorOr> Parser::parse_word() }; auto append_string_literal = [&](StringView string) -> ErrorOr { - if (string.is_empty()) - return {}; - auto node = make_ref_counted( token.position.value_or(empty_position()), TRY(String::from_utf8(string)), @@ -1457,9 +1454,6 @@ ErrorOr> Parser::parse_word() }; auto append_string_part = [&](StringView string) -> ErrorOr { - if (string.is_empty()) - return {}; - auto node = make_ref_counted( token.position.value_or(empty_position()), TRY(String::from_utf8(string)),