Fix quotes-in-commandsubstitution problem with well-placed shlex.quote

This commit is contained in:
Yannick Jadoul
2020-07-19 17:32:07 +02:00
parent 44fd8b5c26
commit 3a2d7a21b1
+1 -1
View File
@@ -97,7 +97,7 @@ def evaluate_nodes_as_compound_command(nodes: Sequence[bashlex.ast.node], contex
def evaluate_nodes_as_simple_command(nodes: List[bashlex.ast.node], context: NodeExecutionContext):
words = [evaluate_node(part, context=context) for part in nodes]
words = [shlex.quote(evaluate_node(part, context=context)) for part in nodes]
command = ' '.join(words)
return context.executor(command, context.environment)