From f1e84802839683eba11166a85e2f9fb5d49f3490 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 3 Aug 2013 14:48:36 -0700 Subject: [PATCH] sys-file-reader: Accept measurement value of zero without complaint. 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 | 4 ++++ doc/dev/system-file-format.texi | 4 ++-- src/data/sys-file-reader.c | 5 ++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 872dd87bfb..92226aa723 100644 --- 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 diff --git a/doc/dev/system-file-format.texi b/doc/dev/system-file-format.texi index 062738181b..af74fd2f60 100644 --- a/doc/dev/system-file-format.texi +++ b/doc/dev/system-file-format.texi @@ -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. diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index fcc2f2d76c..b3315b1e17 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -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) -- 2.30.2