diff options
author | Ryan <fauxpark@gmail.com> | 2022-08-29 04:35:17 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-28 19:35:17 +0100 |
commit | 3adaf6a46ae6bac75997e9f2d2e97f550f1c8e87 (patch) | |
tree | 9ed0b9b6b70b01a8807fca9a8af9a52e167e6944 /lib/python/qmk/cli/generate | |
parent | ac33b7b0b3ed6a7679bdc9c0edc88f5e0f832332 (diff) |
Handle escaping of manufacturer/product strings (#18194)
Diffstat (limited to 'lib/python/qmk/cli/generate')
-rwxr-xr-x | lib/python/qmk/cli/generate/config_h.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index a26dcdf7d7..a2178bf1e9 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -117,9 +117,10 @@ def generate_config_items(kb_info_json, config_h_lines): config_h_lines.append(f'# define {key} {value}') config_h_lines.append(f'#endif // {key}') elif key_type == 'str': + escaped_str = config_value.replace('\\', '\\\\').replace('"', '\\"') config_h_lines.append('') config_h_lines.append(f'#ifndef {config_key}') - config_h_lines.append(f'# define {config_key} "{config_value}"') + config_h_lines.append(f'# define {config_key} "{escaped_str}"') config_h_lines.append(f'#endif // {config_key}') elif key_type == 'bcd_version': (major, minor, revision) = config_value.split('.') |