some of the 31 cases work OK now
[pspp] / dump.c
diff --git a/dump.c b/dump.c
index 6b9c879eed8f3face14cd1e3acc5b3025e7a2e7a..30e34facaf00efcd2fe03470bbeae77df4ba1b28 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -125,6 +125,9 @@ dump_category(int level)
   for (int i = 0; i <= level; i++)
     printf ("    ");
 
+  match_byte (0);
+  match_byte (0);
+  match_byte (0);
   match_byte (0);
   if (match_byte (3))
     {
@@ -166,12 +169,11 @@ dump_category(int level)
       if (!match_u32 (3))
         match_u32_assert (2);
     }
-  else
+  else if (match_byte (1))
     {
       unsigned int format;
       double value;
 
-      match_byte_assert (1);
       match_byte_assert (0x58);
       format = get_u32 ();
       value = get_double ();
@@ -182,6 +184,19 @@ dump_category(int level)
       match_byte (0);
       match_byte (1);
     }
+  else
+    {
+      int subn;
+
+      match_byte_assert (0x31);
+      get_u32 ();
+      get_u32 ();
+      subn = get_u32 ();
+      printf ("nested %d bytes", subn);
+      pos += subn;
+      printf ("; \"%s\"", get_string());
+      goto next;
+    }
 
   if (match_u32 (2))
     get_u32 ();
@@ -197,6 +212,7 @@ dump_category(int level)
       match_u32_assert (0);
       get_u32 ();
     }
+next:;
   int n_categories = get_u32();
   if (n_categories > 0)
     printf (", %d subcategories:", n_categories);