From aafd3d71437306a0b89909dbc697b6241f5d2e7f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 17 Jun 2011 22:16:44 -0700 Subject: [PATCH] sys-file-writer: Omit empty multiple response sets records. Multiple response sets are divided into two records in a .sav file: one record with subtype 7 and one with subtype 19. PSPP was incorrectly writing both records even if one of them was empty. This commit makes it omit the empty record. Thanks to Curt Reinhold for providing the .sav file that led to this discovery. --- src/data/sys-file-writer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/sys-file-writer.c b/src/data/sys-file-writer.c index 6c9d4617..63e14ffb 100644 --- a/src/data/sys-file-writer.c +++ b/src/data/sys-file-writer.c @@ -707,7 +707,8 @@ write_mrsets (struct sfm_writer *w, const struct dictionary *dict, ds_put_byte (&s, '\n'); } - write_string_record (w, ds_ss (&s), pre_v14 ? 7 : 19); + if (!ds_is_empty (&s)) + write_string_record (w, ds_ss (&s), pre_v14 ? 7 : 19); ds_destroy (&s); } -- 2.30.2