From 0353693025b9035ad5415a165d0a2393b765ee8f Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Thu, 22 Dec 2022 17:16:30 +0100 Subject: [PATCH] exec/cmd: flatten_shell_script(): specifically quote empty strings even when shell_quote is disabled --- exec/cmd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exec/cmd.py b/exec/cmd.py index bff9aec..be8218b 100644 --- a/exec/cmd.py +++ b/exec/cmd.py @@ -38,6 +38,8 @@ def flatten_shell_script(script: Union[list[str], str], shell_quote_items: bool cmds = script if shell_quote_items: cmds = [shell_quote(i) for i in cmds] + else: + cmds = [(i if i != '' else '""') for i in cmds] script = " ".join(cmds) if wrap_in_shell_quote: script = shell_quote(script)