From ff97ba9bb3453eb53ae78c7787edcae4ed7f1339 Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Wed, 14 Aug 2024 17:01:02 +0200 Subject: [PATCH] fix qouted string --- script/helpers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/helpers.py b/script/helpers.py index 873d1f895c..b9b1707ccd 100644 --- a/script/helpers.py +++ b/script/helpers.py @@ -180,9 +180,14 @@ CONFIG_NEWLIB_LIBC=y def extract_include_paths(command): include_paths = [] - include_pattern = re.compile(r"(-I|-isystem)\s*([^\s]+)") + include_pattern = re.compile( + r'("-I\s*[^"]+)|(-isystem\s*[^\s]+)|(-I\s*[^\s]+)' + ) for match in include_pattern.findall(command): - include_paths.append(match[1]) + split_strings = re.split( + r"\s*-\s*(?:I|isystem)", list(filter(lambda x: x, match))[0] + ) + include_paths.append(split_strings[1]) return include_paths def extract_defines(command):