From: Ben Pfaff Date: Sat, 8 Dec 2007 06:05:35 +0000 (+0000) Subject: Patch #6302. X-Git-Tag: v0.6.0~167 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23ce39ab4b18e1c86694c3fb9a69e99e48c4c3b0;p=pspp-builds.git Patch #6302. * crosstabs.q (precalc): Initialize data structures even if the first case cannot be read. * frequencies.q (precalc): Ditto. --- diff --git a/src/language/stats/ChangeLog b/src/language/stats/ChangeLog index 21c28c79..fda8c935 100644 --- a/src/language/stats/ChangeLog +++ b/src/language/stats/ChangeLog @@ -1,3 +1,12 @@ +2007-12-07 Ben Pfaff + + Patch #6302. + + * crosstabs.q (precalc): Initialize data structures even if the + first case cannot be read. + + * frequencies.q (precalc): Ditto. + 2007-11-03 Ben Pfaff Allow output files to overwrite input files (bug #21280). diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index 5277e545..3bffa2a3 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -520,10 +520,11 @@ precalc (struct casereader *input, const struct dataset *ds) { struct ccase c; - if (!casereader_peek (input, 0, &c)) - return; - output_split_file_values (ds, &c); - case_destroy (&c); + if (casereader_peek (input, 0, &c)) + { + output_split_file_values (ds, &c); + case_destroy (&c); + } if (mode == GENERAL) { diff --git a/src/language/stats/frequencies.q b/src/language/stats/frequencies.q index fdb19b03..ef4769b6 100644 --- a/src/language/stats/frequencies.q +++ b/src/language/stats/frequencies.q @@ -538,10 +538,11 @@ precalc (struct casereader *input, struct dataset *ds) struct ccase c; size_t i; - if (!casereader_peek (input, 0, &c)) - return; - output_split_file_values (ds, &c); - case_destroy (&c); + if (casereader_peek (input, 0, &c)) + { + output_split_file_values (ds, &c); + case_destroy (&c); + } pool_destroy (data_pool); data_pool = pool_create ();