Windows specific fixes
authorMiodrag Milanovic <mmicko@gmail.com>
Mon, 22 Mar 2021 15:48:33 +0000 (16:48 +0100)
committerMiodrag Milanovic <mmicko@gmail.com>
Mon, 22 Mar 2021 15:48:33 +0000 (16:48 +0100)
sbysrc/sby_core.py

index bf1b66ebb749affb8bf925949e089df2aa42664d..eac1bfddb7f3d0f05a5469d01cf5ff6eb0390ae0 100644 (file)
@@ -64,11 +64,14 @@ class SbyTask:
                 "{" : "(",
                 "}" : ")",
             }
-
-            cmdline_copy = cmdline
-            for u, w in replacements.items():
-                cmdline_copy = cmdline_copy.replace(u, w)
-            self.cmdline = cmdline_copy
+            parts = cmdline.split("'")
+            for i in range(len(parts)):
+                if i % 2 == 0:
+                    cmdline_copy = parts[i]
+                    for u, w in replacements.items():
+                        cmdline_copy = cmdline_copy.replace(u, w)
+                    parts[i] = cmdline_copy
+            self.cmdline = '"'.join(parts)
         self.logfile = logfile
         self.noprintregex = None
         self.notify = []