some footnotes work (76 errors).
[pspp] / dump.c
diff --git a/dump.c b/dump.c
index 9e1ff64e6223c90d0d8f32040fe2535876887069..2ba8e8b3edebe60394a29b34ffc157a6b92c697b 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 ();
@@ -1219,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);
@@ -1274,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))
     {
@@ -1281,6 +1280,21 @@ dump_title(void)
     }
   else
     match_byte_assert(0x58);
+
+
+  int n_footnotes = get_u32();
+  fprintf(stderr, "%d footnotes\n", n_footnotes);
+  printf("------\n%d footnotes\n", n_footnotes);
+  if (n_footnotes < 10)
+    {
+      for (int i = 0; i < n_footnotes; i++)
+        {
+          printf("footnote %d:\n", i);
+          dump_value(0);
+          match_byte_assert(0x58);
+          printf("(%d)\n", get_u32());
+        }
+    }
 }
 
 int