File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -324,8 +324,9 @@ def _normalize_define(define_string):
324324 define_string = define_string .strip ()
325325 if "=" in define_string :
326326 define , value = define_string .split ("=" , maxsplit = 1 )
327- if '"' in value and not value .startswith ("\\ " ):
328- # Escape only raw values
327+ if any (char in value for char in (' ' , '<' , '>' )):
328+ value = f'"{ value } "'
329+ elif '"' in value and not value .startswith ("\\ " ):
329330 value = value .replace ('"' , '\\ "' )
330331 return (define , value )
331332 return define_string
@@ -336,8 +337,11 @@ def _normalize_define(define_string):
336337 ]
337338
338339 for f in compile_group .get ("compileCommandFragments" , []):
339- if f .get ("fragment" , "" ).startswith ("-D" ):
340- result .append (_normalize_define (f ["fragment" ][2 :]))
340+ fragment = f .get ("fragment" , "" ).strip ()
341+ if fragment .startswith ('"' ):
342+ fragment = fragment .strip ('"' )
343+ if fragment .startswith ("-D" ):
344+ result .append (_normalize_define (fragment [2 :]))
341345
342346 return result
343347
You can’t perform that action at this time.
0 commit comments