[kdbus] Do not set body message if signature field is empty
[platform/upstream/glib.git] / gobject / glib-mkenums.in
index 34440aa..b776e1f 100755 (executable)
@@ -290,6 +290,9 @@ while (<>) {
        ([^*]+|\*(?!/))*
        \*/@@gx;
        
+    # ignore forward declarations
+    next if /^\s*typedef\s+enum.*;/;
+
     if (m@^\s*typedef\s+enum\s*
            ({)?\s*
            (?:/\*<
@@ -321,6 +324,9 @@ while (<>) {
        # Didn't have trailing '{' look on next lines
        if (!defined $1 && !defined $4) {
            while (<>) {
+               if (eof) {
+                   die "Hit end of file while parsing enum in $ARGV";
+               }
                if (s/^\s*\{//) {
                    last;
                }