From b6ecb89e008dde2ea999be48f5a732626f0c9389 Mon Sep 17 00:00:00 2001 From: "Mr.Stiven" Date: Fri, 7 Aug 2020 22:12:46 +0300 Subject: [PATCH] Add support for parsing non-unix paths in compilation database 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: