Adopt use of gnulib for portability.
[pspp-builds.git] / src / pfm-read.c
index 7967926e600c0cb33a99859f487b85eac1483d48..c7a604dbf0949f2e2052dbbdc409fa48ce1381fe 100644 (file)
 #include <math.h>
 #include <setjmp.h>
 #include "alloc.h"
-#include "bool.h"
+#include <stdbool.h>
 #include "case.h"
 #include "dictionary.h"
 #include "file-handle.h"
 #include "format.h"
-#include "getline.h"
+#include "getl.h"
 #include "hash.h"
 #include "magic.h"
 #include "misc.h"
@@ -44,6 +44,9 @@
 #include "value-labels.h"
 #include "var.h"
 
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
 #include "debug-print.h"
 
 /* Portable file reader. */
@@ -408,7 +411,7 @@ read_header (struct pfm_reader *r)
 static void
 read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
 {
-  char *date, *time, *product, *subproduct;
+  char *date, *time, *product, *author, *subproduct;
   int i;
 
   /* Read file. */
@@ -417,6 +420,7 @@ read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
   date = read_pool_string (r);
   time = read_pool_string (r);
   product = match (r, '1') ? read_pool_string (r) : (unsigned char *) "";
+  author = match (r, '2') ? read_pool_string (r) : (unsigned char *) "";
   subproduct
     = match (r, '3') ? read_pool_string (r) : (unsigned char *) "";
 
@@ -522,7 +526,7 @@ read_variables (struct pfm_reader *r, struct dictionary *dict)
         fmt[j] = read_int (r);
 
       if (!var_is_valid_name (name, false) || *name == '#' || *name == '$')
-        error (r, _("position %d: Invalid variable name `%s'."), name);
+        error (r, _("position %d: Invalid variable name `%s'."), i, name);
       str_uppercase (name);
 
       if (width < 0 || width > 255)