glib-mkenums.in: fix @ENUMPREFIX@ with /*< underscore_name=... >*/
authorDan Winship <danw@gnome.org>
Fri, 14 Oct 2011 18:32:11 +0000 (14:32 -0400)
committerDan Winship <danw@gnome.org>
Fri, 28 Oct 2011 19:44:13 +0000 (15:44 -0400)
For enums defined with an underscore_name override, @ENUMPREFIX@
would include a trailing "_". Fix.

https://bugzilla.gnome.org/show_bug.cgi?id=661797

gobject/glib-mkenums.in

index 6372245..af0304d 100755 (executable)
@@ -379,7 +379,7 @@ while (<>) {
            $enumshort =~ s/^[A-Z][A-Z0-9]*_//;
 
            $enumname_prefix = $enumlong;
-           $enumname_prefix =~ s/$enumshort$//;
+           $enumname_prefix =~ s/_$enumshort$//;
        } else {
            # enumname is e.g. GMatchType
            $enspace = $enumname;