sys-file-reader: Accept measurement value of zero without complaint. 20130804030502/pspp
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 3 Aug 2013 21:48:36 +0000 (14:48 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 3 Aug 2013 22:12:30 +0000 (15:12 -0700)
SPSS 14 seemed to output a measurement value of 0 for string variables,
but SPSS 21 does the same thing for numeric variables.  We might as well
accept it.

Reported by Mindaugus.
Bug #39502

NEWS
doc/dev/system-file-format.texi
src/data/sys-file-reader.c

diff --git a/NEWS b/NEWS
index 872dd87bfb6f990269588abede970fec70daebdb..92226aa72358b218d8e01debbdcafe13ecb8f4b1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
 
 Changes after 0.8.0:
 
+ * Notable bug fixes:
+
+   - System files written by IBM SPSS 21 are now read without warnings.
+
  * PSPPIRE graphical user interface improvements:
 
    - Syntax windows now parse syntax in "auto" mode, which in practice
index 062738181baa6923144e5af332c59355e6ee3a17..af74fd2f600c6e95f0380afa23465605365263b8 100644 (file)
@@ -831,8 +831,8 @@ Ordinal Scale
 Continuous Scale
 @end table
 
-SPSS 14 sometimes writes a @code{measure} of 0 for string variables.
-PSPP interprets this as nominal scale.
+SPSS sometimes writes a @code{measure} of 0.  PSPP interprets this as
+nominal scale.
 
 @item int32 width;
 The width of the display column for the variable in characters.
index fcc2f2d76caec9881d193c26b1186f8fcd168a86..b3315b1e17381bcd1cbbed241ba6acf4d53ab633 100644 (file)
@@ -1514,9 +1514,8 @@ parse_display_parameters (struct sfm_reader *r,
       align = parse_int (r, record->data, ofs);
       ofs += 4;
 
-      /* SPSS 14 sometimes seems to set string variables' measure
-         to zero. */
-      if (0 == measure && var_is_alpha (v))
+      /* SPSS sometimes seems to set variables' measure to zero. */
+      if (0 == measure)
         measure = 1;
 
       if (measure < 1 || measure > 3 || align < 0 || align > 2)