]> git.ozlabs.org Git - ccan/blobdiff - ccan/cdump/cdump.c
cdump: handle , at end of enums.
[ccan] / ccan / cdump / cdump.c
index 20cdb4eb1f6edafa613d5e7589bfb6c3a77e7e2b..2680b4d20058a14fa2cad3b8bffa35a944f952b1 100644 (file)
@@ -428,6 +428,10 @@ static bool tok_take_enum(struct parse_state *ps)
        do {
                struct cdump_enum_val *v;
 
+               /* GCC extension: comma and end of enum */
+               if (tok_is(&ps->toks, "}"))
+                       break;
+
                tal_resize(&e->u.enum_vals, n+1);
                v = &e->u.enum_vals[n++];