/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013, 2014, 2017 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
for (y = 0; y < table_nr (t); y++)
{
int x;
-
for (x = 0; x < table_nc (t); )
{
const struct cell_contents *c;
table_get_cell (t, x, y, &cell);
if (y != cell.d[TABLE_VERT][0])
- continue;
+ goto next_0;
for (c = cell.contents; c < &cell.contents[cell.n_contents]; c++)
{
strlen (c->footnotes[i]), " ", "<BR>");
}
}
+
+ next_0:
x = cell.d[TABLE_HORZ][1];
table_cell_free (&cell);
}
table_get_cell (t, x, y, &cell);
if (x != cell.d[TABLE_HORZ][0] || y != cell.d[TABLE_VERT][0])
- continue;
+ goto next_1;
/* Output <TD> or <TH> tag. */
is_header = (y < table_ht (t)
/* Output </TH> or </TD>. */
fprintf (html->file, "</%s>\n", tag);
+ next_1:
x = cell.d[TABLE_HORZ][1];
table_cell_free (&cell);
}
--- /dev/null
+AT_BANNER([HTML driver])
+
+AT_SETUP([HTML bug])
+
+dnl Checks for a bug which caused the html driver to go into a tight loop.
+AT_DATA([foo.sps], [data list notable list /w l96_r l99_r l102_r *.
+begin data.
+15 0 0 0
+ 1 1 1 1
+ 2 1 1 2
+ 1 1 2 1
+ 1 1 2 2
+ 1 2 1 1
+ 4 2 2 1
+ 2 2 2 2
+end data.
+
+weight by w.
+
+crosstabs
+ /tables=l96_r by l99_r by l102_r
+ /format=avalue table pivot
+ /statistics=none
+ /cell=count.
+])
+
+AT_CHECK([pspp -O format=html foo.sps], [0], [ignore])
+
+AT_CLEANUP
\ No newline at end of file