All titles pass!
[pspp] / dump.c
diff --git a/dump.c b/dump.c
index 3047e3d8ad0835485133dff9d8b4bebba9843cc1..96611d976e2da517fa48dbbbc3d2d46aa321dd9a 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1013,6 +1013,7 @@ dump_title_value(int level)
   match_byte (0);
   match_byte (0);
   match_byte (0);
+  match_byte (0);
   if (match_byte (3))
     {
       get_string();
@@ -1032,7 +1033,8 @@ dump_title_value(int level)
               printf("(special 2)");
               match_byte_assert(0);
               match_byte_assert(0);
-              match_u32_assert(1);
+              if (!match_u32(2))
+                match_u32_assert(1);
               match_byte_assert(0);
               match_byte_assert(0);
               int subn = get_u32 ();
@@ -1071,7 +1073,20 @@ dump_title_value(int level)
     }
   else if (match_byte (5))
     {
-      match_byte_assert (0x58);
+      if (match_byte (0x31))
+        {
+          if (match_u32 (1))
+            {
+              printf("(footnote %d) ", get_u32());
+              match_byte_assert (0);
+              match_byte_assert (0);
+              int subn = get_u32 ();
+              printf ("nested %d bytes", subn);
+              pos += subn;
+            }
+        }
+      else
+        match_byte_assert (0x58);
       printf ("variable \"%s\"", get_string());
       get_string();
       if (!match_byte(1) && !match_byte(2))
@@ -1206,10 +1221,6 @@ dump_title_value(int level)
                     printf ("    ");
                   printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
                   match_byte(0);
-                  match_byte(0);
-                  match_byte(0);
-                  match_byte(0);
-                  match_byte(0);
                 }
               else
                 dump_title_value (level+1);
@@ -1261,6 +1272,7 @@ dump_title(void)
   dump_title_value(0); putchar('\n'); putchar('\n');
   match_byte_assert(0x31);
   dump_title_value(0); putchar('\n'); putchar('\n');
+  match_byte(0);
   match_byte_assert(0x58);
   if (match_byte(0x31))
     {