Make dump_footnote_value() more like dump_value().
[pspp] / dump.c
diff --git a/dump.c b/dump.c
index 57bc9b4489e186abc35175038c40d53ed6031cc1..ede89f96ec14f758c8ee18bf77564575811ef3a3 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -319,6 +319,7 @@ dump_value(int level)
               printf("variable %d has %d values:\n", i, y);
               for (int j = 0; j < y; j++)
                 {
+                  match_byte(0);
                   if (match_byte(3))
                     {
                       char *a = get_string();
@@ -328,14 +329,14 @@ dump_value(int level)
                       for (int k = 0; k <= level + 1; k++)
                         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_value (level+1);
+
+                  match_byte(0);
+                  match_byte(0);
+                  match_byte(0);
+                  match_byte(0);
                   putchar('\n');
                 }
             }
@@ -363,7 +364,7 @@ dump_dim_value(int level)
       match_byte_assert (0x58);
       printf ("variable \"%s\"", get_string());
       get_string();
-      if (!match_byte (2))
+      if (!match_byte (1) && !match_byte (2))
         match_byte_assert(3);
     }
   else if (match_byte (2))
@@ -379,8 +380,10 @@ dump_dim_value(int level)
       vallab = get_string ();
       printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
               value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
-      if (!match_u32 (3))
-        match_u32_assert (2);
+      if (!match_byte (1) && !match_byte (2))
+        match_byte_assert (3);
+      match_byte (0);
+      match_byte (0);
       match_byte (0);
     }
   else if (match_byte (1))
@@ -388,7 +391,7 @@ dump_dim_value(int level)
       unsigned int format;
       double value;
 
-      match_byte_assert (0x58);
+      dump_value_31 ();
       format = get_u32 ();
       value = get_double ();
       printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
@@ -396,11 +399,9 @@ dump_dim_value(int level)
       match_byte (0);
       match_byte (0);
       match_byte (0);
-      match_byte (1);
     }
   else
     {
-      match_byte (0);
       dump_value_31();
       printf ("; \"%s\", substitutions:", get_string());
       int total_subs = get_u32();
@@ -571,7 +572,6 @@ dump_data_value(void)
       match_byte (0);
       match_byte (0);
       match_byte (0);
-      match_byte (0);
     }
   else
     {
@@ -788,10 +788,6 @@ dump_footnote_value(int level)
       match_byte (0);
       match_byte (0);
       match_byte (0);
-      match_byte (0);
-      match_byte (0);
-      match_byte (0);
-      match_byte (0);
     }
   else if (match_byte (4))
     {
@@ -810,7 +806,6 @@ dump_footnote_value(int level)
       match_byte (0);
       match_byte (0);
       match_byte (0);
-      match_byte (0);
     }
   else if (match_byte (1))
     {