glib-mkenums: Fix support for comment templates

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.
This commit is contained in:
Ryan Lortie 2010-05-06 12:36:10 -05:00
parent 5b4189fc42
commit 7aa71527e5

View File

@ -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]) {