From: Ben Pfaff Date: Sat, 26 Jun 2010 19:28:28 +0000 (-0700) Subject: output: Fix logic error in table_select_slice(). X-Git-Tag: v0.7.6~349 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86fcc54cf91e2811c0aed10acfc86fc911f01206;p=pspp-builds.git output: Fix logic error in table_select_slice(). z1 is a row or column number, not a count of header rows or columns, so it only makes sense to compare it against another row or column number, not against a count of rows or columns. --- diff --git a/src/output/table-select.c b/src/output/table-select.c index 1c2956a8..241448e5 100644 --- a/src/output/table-select.c +++ b/src/output/table-select.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 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 @@ -97,7 +97,8 @@ table_select_slice (struct table *subtable, enum table_axis axis, if (add_headers) { - if (z0 == subtable->h[axis][0] && z1 == subtable->h[axis][1]) + if (z0 == subtable->h[axis][0] + && z1 == subtable->n[axis] - subtable->h[axis][1]) return subtable; if (subtable->h[axis][0])