From: pjk Date: Thu, 13 May 2004 18:31:13 +0000 (+0000) Subject: Adjusted code for DATA LIST (free/list) to be more consistent with SPSS in X-Git-Tag: v0.4.0~263 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=965d82cdc50d81c07b736a0f92c680fdb010c976;p=pspp-builds.git Adjusted code for DATA LIST (free/list) to be more consistent with SPSS in the instance where delimiters are explicitly set. In particular, if a delim. is explicitly set, we treat quotes / apostrophes as normal chars: From SPSS Syntax Base manual: For data with explicitly specified value delimiters (for example, DATA LIST FREE (","): · Multiple delimiters without any intervening space can be used to specify missing data. · The specified delimiters cannot occur within a data value, even if you enclose the value in quotation marks or apostrophes. --- diff --git a/src/data-list.c b/src/data-list.c index a80fff30..62734de1 100644 --- a/src/data-list.c +++ b/src/data-list.c @@ -970,7 +970,16 @@ cut_field (const struct data_list_pgm *dls, char **ret_cp, int *ret_len) return 0; /* Three types of fields: quoted with ', quoted with ", unquoted. */ - if (*cp == '\'' || *cp == '"') + /* Quoting does not escape the effects of delimiters for explicitly */ + /* specified delims */ + /* (consistency with SPSS doco: */ + /* For data with explicitly specified value delimiters (for example, */ + /* DATA LIST FREE (","): */ + /* - Multiple delimiters without any intervening space can be used */ + /* to specify missing data. */ + /* - The specified delimiters cannot occur within a data value, even */ + /* if you enclose the value in quotation marks or apostrophes. */ + if (dls->delim==0 && (*cp == '\'' || *cp == '"')) { int quote = *cp;