gen_defines: don't emit comments with "# " lines

If the line is empty, just emit a single "#\n" instead of "# \n".

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2020-01-29 08:43:00 -08:00 committed by Kumar Gala
commit d406439570

View file

@ -805,7 +805,8 @@ def out_comment(s, blank_before=True):
# /* foo bar */
print("/* " + s + " */", file=header_file)
print("\n".join("# " + line for line in s.splitlines()), file=conf_file)
print("\n".join("# " + line if line.strip() else "#"
for line in s.splitlines()), file=conf_file)
def escape(s):