From 13b2c5ba597b383792d1d3eac4408d6e10959b7c Mon Sep 17 00:00:00 2001 From: papadokolos Date: Wed, 9 Dec 2020 01:10:33 +0200 Subject: [PATCH] Add support for parsing non-unix paths in compilation database (#716) This is selected automatically by checking the OS in which ECC is running. Without this, `shlex` would not treat windows paths correctly. --- plugin/flags_sources/compilation_db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/flags_sources/compilation_db.py b/plugin/flags_sources/compilation_db.py index 76eb5e9e..a21fb19f 100644 --- a/plugin/flags_sources/compilation_db.py +++ b/plugin/flags_sources/compilation_db.py @@ -131,7 +131,9 @@ def _parse_entry(self, entry, base_path): base_path = path.realpath(entry['directory']) if 'command' in entry: import shlex - argument_list = shlex.split(entry['command']) + import os + argument_list = shlex.split(entry['command'], + posix=os.name == 'posix') elif 'arguments' in entry: argument_list = entry['arguments'] else: