From 3a58988e4acf4fd3a0d0afdd3e3de89c17d01286 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Tue, 23 Aug 2022 13:46:50 -0400 Subject: [PATCH] escape single quotes in the command stream so as not to confuse the shlex parser --- scripts/dream.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dream.py b/scripts/dream.py index fb8fec2384..ff1fbcdd05 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -107,6 +107,10 @@ def main_loop(t2i,parser,log,infile): if command.startswith(('#','//')): continue + # before splitting, escape single quotes so as not to mess + # up the parser + command = command.replace("'","\\'") + try: elements = shlex.split(command) except ValueError as e: