uvision exporter: Escape double quote in flags.

Without this fix macro defined as -DFOO="BAR" won't be correctly handled
by uvision.
pull/4366/head
Vincent Coubard 2017-05-23 14:04:05 +01:00
parent da9b8f3dee
commit deaabf3123
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ class Uvision(Exporter):
# Flag is invalid if set in template # Flag is invalid if set in template
# Optimizations are also set in the template # Optimizations are also set in the template
invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x) invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x)
flags['c_flags'] = [flag for flag in c_flags if not invalid_flag(flag)] flags['c_flags'] = [flag.replace('"','\\"') for flag in c_flags if not invalid_flag(flag)]
flags['c_flags'] = " ".join(flags['c_flags']) flags['c_flags'] = " ".join(flags['c_flags'])
return flags return flags