From: Ben Pfaff Date: Sat, 18 Jun 2011 05:12:45 +0000 (-0700) Subject: sys-file-writer: Write variable names in mrsets in lowercase. X-Git-Tag: v0.7.9~277 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=395ce69d5ae119571907e58b061505b54bf32ed7;p=pspp-builds.git sys-file-writer: Write variable names in mrsets in lowercase. SPSS appears to write the short names of the variables in a multiple response set in lowercase, so this commit make PSPP do the same. Thanks to Curt Reinhold for providing the .sav file that led to this discovery. --- diff --git a/doc/dev/system-file-format.texi b/doc/dev/system-file-format.texi index 84b3f66f..6276b6de 100644 --- a/doc/dev/system-file-format.texi +++ b/doc/dev/system-file-format.texi @@ -676,7 +676,8 @@ following: @itemize @bullet @item -The set's name (an identifier that begins with @samp{$}). +The set's name (an identifier that begins with @samp{$}), in mixed +upper and lower case. @item An equals sign (@samp{=}). @@ -717,8 +718,8 @@ written if LABELSOURCE=VARLABEL was specified. A space. @item -The names of the variables in the set, each separated from the -previous by a single space. +The short names of the variables in the set, converted to lowercase, +each separated from the previous by a single space. @item A line feed (byte 0x0a). diff --git a/src/data/sys-file-writer.c b/src/data/sys-file-writer.c index 0aeb93a0..6c9d4617 100644 --- a/src/data/sys-file-writer.c +++ b/src/data/sys-file-writer.c @@ -700,6 +700,7 @@ write_mrsets (struct sfm_writer *w, const struct dictionary *dict, const char *short_name_utf8 = var_get_short_name (mrset->vars[j], 0); char *short_name = recode_string (encoding, "UTF-8", short_name_utf8, -1); + str_lowercase (short_name); ds_put_format (&s, " %s", short_name); free (short_name); }