Generalize even more special cases in dump_title_value().
[pspp] / dump.c
diff --git a/dump.c b/dump.c
index cb80dd9295795d0feb1eb10ab2ad591a16fbd0bd..052e77784852c11c089a6e8f1c316687c90eaffc 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1012,7 +1012,14 @@ dump_title_value_31(int level)
 {
   if (match_byte (0x31))
     {
-      if (match_u32 (1))
+      if (match_u32 (0))
+        {
+          match_u32_assert (0);
+          int subn = get_u32 ();
+          printf ("nested %d bytes", subn);
+          pos += subn;
+        }
+      else if (match_u32 (1))
         {
           printf("(footnote %d) ", get_u32());
           match_byte_assert (0);
@@ -1136,20 +1143,7 @@ dump_title_value(int level)
       unsigned int format;
       double value;
 
-      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);
+      dump_title_value_31(level);
       format = get_u32 ();
       value = get_double ();
       printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
@@ -1161,43 +1155,7 @@ dump_title_value(int level)
     }
   else
     {
-      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 if (match_u32 (0))
-            {
-              match_u32_assert (0);
-              int subn = get_u32 ();
-              printf ("nested %d bytes", subn);
-              pos += subn;
-            }
-          else
-            {
-              match_u32_assert(3);
-              printf("(special 3)");
-              match_byte_assert(0);
-              match_byte_assert(0);
-              match_byte_assert(1);
-              match_byte_assert(0);
-              int subn = get_u32 ();
-              printf ("nested %d bytes, ", subn);
-              pos += subn;
-              subn = get_u32 ();
-              printf ("nested %d bytes, ", subn);
-              pos += subn;
-            }
-
-        }
-      else
-        match_byte_assert (0x58);
+      dump_title_value_31(level);
 
       char *base = get_string();
       int x = get_u32();