exec/cmd: flatten_shell_script(): specifically quote empty strings even when shell_quote is disabled

This commit is contained in:
InsanePrawn 2022-12-22 17:16:30 +01:00
parent f6fb521c8a
commit 0353693025

View file

@ -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)