From 0c7d52ba22ae04945b58f9a70e2de5df3733fc92 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 19 Oct 2017 10:15:49 +0100 Subject: [PATCH] glib-mkenums: Add default comment template if none is provided MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fallback code for providing a default comment template only worked if a template file was provided. It didn’t work if individual templates were provided on the command line (and --comment wasn’t). Signed-off-by: Philip Withnall https://bugzilla.gnome.org/show_bug.cgi?id=788990 --- gobject/glib-mkenums.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in index 6f365c22b..7cc55053c 100755 --- a/gobject/glib-mkenums.in +++ b/gobject/glib-mkenums.in @@ -281,10 +281,6 @@ def read_template_file(file): vtail = tmpl['value-tail'] comment_tmpl = tmpl['comment'] - # default to C-style comments - if comment_tmpl == "": - comment_tmpl = "/* \u0040comment\u0040 */" - parser = argparse.ArgumentParser(epilog=help_epilog, formatter_class=argparse.RawDescriptionHelpFormatter) @@ -366,6 +362,9 @@ vtail = vtail + ''.join([unescape_cmdline_args(x) for x in options.vtail]) if options.comment_tmpl != '': comment_tmpl = unescape_cmdline_args(options.comment_tmpl) +elif comment_tmpl == "": + # default to C-style comments + comment_tmpl = "/* \u0040comment\u0040 */" output = options.output