pspp-dump-sav: Print a new-line following text record content.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 3 Aug 2013 20:38:03 +0000 (13:38 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 3 Aug 2013 21:49:11 +0000 (14:49 -0700)
Text records don't necessarily end in a new-line so this ensures that the
next line of output starts at the beginning of a line.

utilities/pspp-dump-sav.c

index a3aad0bf249ff7cebc21b7e8ff75905b48041e64..98cb6f3b22ed7ae6673081365fce531c52984069 100644 (file)
@@ -1070,17 +1070,20 @@ read_unknown_extension (struct sfm_reader *r, size_t size, size_t count)
       buffer = xmalloc (count);
       read_bytes (r, buffer, count);
       if (memchr (buffer, 0, count) == 0)
-        for (i = 0; i < count; i++)
-          {
-            unsigned char c = buffer[i];
-
-            if (c == '\\')
-              printf ("\\\\");
-            else if (c == '\n' || isprint (c))
-              putchar (c);
-            else
-              printf ("\\%02x", c);
-          }
+        {
+          for (i = 0; i < count; i++)
+            {
+              unsigned char c = buffer[i];
+
+              if (c == '\\')
+                printf ("\\\\");
+              else if (c == '\n' || isprint (c))
+                putchar (c);
+              else
+                printf ("\\%02x", c);
+            }
+          putchar ('\n');
+        }
       else
         hex_dump (0, buffer, count);
       free (buffer);