Index: action.py ================================================================== --- action.py +++ action.py @@ -184,12 +184,16 @@ def quote(ins): if type(ins) is list: return " ".join([quote(s) for s in ins]) # Windows: double quotes elif conf.windows: - return subprocess.list2cmdline([ins]) - return '"%s"' % ins + if re.search(r"""[()<>&%!^'";\s]""", ins): + ins = re.sub(r"([()<>&%^])", "^$1", ins) + ins = ins.replace('"', '\\^"') + return '"%s"' % ins + else: + return subprocess.list2cmdline([ins]) # Posix-style shell quoting else: return pipes.quote(ins) return "%r" % ins