+
+Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
+
+ * Fixed a bug apparent when using the FREQUENCIES command with the
+ html driver. The html driver was incorrectly trying to display
+ empty cells.
+
Sun Jan 2 21:40:13 2000 Ben Pfaff <blp@gnu.org>
* Makefile.am: Reorganized. Put locale dir in version.c instead
int_pool = pool_create ();
result = internal_cmd_frequencies ();
pool_destroy (int_pool);
+ int_pool=0;
pool_destroy (gen_pool);
+ gen_pool=0;
free (v_variables);
+ v_variables=0;
return result;
}
strcpy (cp, ">");
fputs (header, x->file.file);
- {
- char *s = ls_value (cc);
- size_t l = ls_length (cc);
-
- while (l && isspace ((unsigned char) *s))
- {
- l--;
- s++;
- }
+ if ( ! (*ct & TAB_EMPTY) )
+ {
+ char *s = ls_value (cc);
+ size_t l = ls_length (cc);
+
+ while (l && isspace ((unsigned char) *s))
+ {
+ l--;
+ s++;
+ }
- escape_string (x->file.file, s, l);
- }
+ escape_string (x->file.file, s, l);
+ }
fprintf (x->file.file, "</T%c>\n", tag);
}
}
\f
/* Driver. */
-struct outp_driver *d;
+static struct outp_driver *d=0;
/* Table. */
-struct som_table *t;
+static struct som_table *t=0;
/* Flags. */
static unsigned flags;
void
ds_concat (struct string *st, const char *s)
{
- size_t s_len = strlen (s);
+ size_t s_len;
+
+ if (!s) return;
+
+ s_len = strlen (s);
ds_extend (st, st->length + s_len);
strcpy (st->string + st->length, s);
st->length += s_len;
{
assert (t != NULL);
pool_destroy (t->container);
+ t->container=0;
}
/* Sets the width and height of a table, in columns and rows,
bench:
make BENCHMARK=1 check
-TESTS = syntax
+TESTS = syntax bugs/double-frequency.sh bugs/html-frequency.sh
noinst_PROGRAMS = gengarbage
--- /dev/null
+#!/bin/sh
+
+# This program tests for a bug where pspp would crash
+# when a FREQUENCIES command was used with the html
+# driver.
+
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+here=`pwd`;
+
+activity="create data"
+cat << EOF > $TEMPDIR/ff.stat
+
+data list free /v1 v2.
+begin data.
+0 1
+2 3
+4 5
+3 4
+end data.
+
+frequencies v1 v2.
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+cd $TEMPDIR
+
+activity="run data"
+$here/../src/pspp -o html $TEMPDIR/ff.stat
+if [ $? -ne 0 ] ; then fail ; fi
+
+
+pass;