glib-mkenums: Fix support for comment templates
authorRyan Lortie <desrt@desrt.ca>
Thu, 6 May 2010 17:36:10 +0000 (12:36 -0500)
committerRyan Lortie <desrt@desrt.ca>
Thu, 6 May 2010 18:27:26 +0000 (13:27 -0500)
Currently, specifying a comment template in the template file results in
the given template being appended to the default (C-style) one rather
than replacing it.

This causes it to be replaced outright.

Bug 617940.

gobject/glib-mkenums.in

index 6dcb474..db4ebd3 100755 (executable)
@@ -174,8 +174,7 @@ my $eprod = "";   # per enum text (produced prior to value itarations)
 my $vhead = "";   # value header, produced before iterating over enum values
 my $vprod = "";   # value text, produced for each enum value
 my $vtail = "";   # value tail, produced after iterating over enum values
-# other options
-my $comment_tmpl = "/* \@comment\@ */";
+my $comment_tmpl = "";   # comment template
 
 sub read_template_file {
   my ($file) = @_;
@@ -218,6 +217,9 @@ sub read_template_file {
   $vprod = $tmpl{'value-production'};
   $vtail = $tmpl{'value-tail'};
   $comment_tmpl = $tmpl{'comment'};
+
+  # default to C-style comments
+  $comment_tmpl = "/* \@comment\@ */" if $comment_tmpl eq "";
 }
 
 if (!defined $ARGV[0]) {