Skip to content

Commit a8d1b70

Browse files
committed
don't split commands in POSIX mode on Windows [GH-17]
Patch courtesy of @ifree. Apparently this breaks the test under Windows, but I cannot test easily and Travis doesn't test this platform. Eventually a Windows user can propose a PR to fix that.
1 parent 43a3455 commit a8d1b70

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compdb/backend/json.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ def _dict_to_compile_command(d):
4545
else:
4646
# PERFORMANCE: I think shlex is inherently slow,
4747
# something performing better may be necessary
48-
arguments = shlex.split(d['command'])
48+
arguments = shlex.split(d['command'],
49+
# XXX: os.name is "posix" on mysys2/cygwin,
50+
# is that correct?
51+
posix=os.name == "posix")
4952
return CompileCommand(d['directory'], d['file'], arguments,
5053
d.get('output'))
5154

0 commit comments

Comments
 (0)