+Sat Apr 3 11:43:37 2004 Ben Pfaff <blp@gnu.org>
+
+ * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I
+ hope).
+
Sat Apr 3 15:00:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
* frequencies.q: Fixed the calculation of percentiles
/* Nonzero only if this line ends with a terminal dot. */
static int dot;
-/* Nonzero only if the last token returned was T_EOF. */
+/* Nonzero only if the last token returned was T_STOP. */
static int eof;
/* If nonzero, next token returned by lex_get().
{
for (;;)
{
- lex_get_line ();
+ if (!lex_get_line ())
+ {
+ put_token = T_STOP;
+ eof = 1;
+ return;
+ }
+
if (put_token == '.')
break;
+Sat Apr 3 11:42:31 2004 Ben Pfaff <blp@gnu.org>
+
+ * Makefile.am: (TESTS) Add bugs/comment-at-eof.sh. Alphabetize
+ test order.
+
+ * bugs/comment-at-eof.sh: Add test for a bug where a comment at
+ end of file caused an infinite loop.
+
Sat Mar 27 11:29:06 WST 2004 John Darrington <john@darrington.wattle.id.au>
* bugs/get.sh Added regression test for a bug in loading a dictionary
## Process this file with automake to produce Makefile.in -*- makefile -*-
TESTS_ENVIRONMENT=top_srcdir=${top_srcdir}
-TESTS = command/aggregate.sh \
+TESTS = \
+ command/aggregate.sh \
command/autorecod.sh \
command/beg-data.sh \
command/bignum.sh \
command/print.sh \
command/sample.sh \
command/sort.sh \
- command/tabs.sh \
command/split-file.sh \
- command/t-test-1s.sh \
- command/t-test-pairs.sh \
- command/t-test-groups.sh \
command/t-test-1-indep-val.sh \
- command/t-test-1-sample-missing-list.sh \
- command/t-test-paired-missing-list.sh \
- command/t-test-paired-missing-anal.sh \
command/t-test-1-sample-missing-anal.sh \
- command/t-test-indep-missing-list.sh \
+ command/t-test-1-sample-missing-list.sh \
+ command/t-test-1s.sh \
+ command/t-test-groups.sh \
command/t-test-indep-missing-anal.sh \
+ command/t-test-indep-missing-list.sh \
+ command/t-test-paired-missing-anal.sh \
+ command/t-test-paired-missing-list.sh \
+ command/t-test-pairs.sh \
+ command/tabs.sh \
command/use.sh \
command/weight.sh \
bugs/alpha-freq.sh \
+ bugs/comment-at-eof.sh \
bugs/compute-fmt.sh \
+ bugs/crosstabs.sh \
+ bugs/data-crash.sh \
bugs/double-frequency.sh \
bugs/get.sh \
bugs/html-frequency.sh \
- bugs/crosstabs.sh \
- bugs/data-crash.sh \
bugs/multipass.sh \
bugs/random.sh \
- bugs/t-test.sh \
bugs/t-test-with-temp.sh \
+ bugs/t-test.sh \
bugs/temporary.sh \
bugs/val-labs.sh \
xforms/casefile.sh \
stats/descript-basic.sh \
stats/descript-missing.sh \
stats/moments.sh \
- stats/percentiles-enhanced.sh \
- stats/percentiles-compatible.sh
+ stats/percentiles-compatible.sh \
+ stats/percentiles-enhanced.sh
noinst_PROGRAMS = gengarbage
--- /dev/null
+#!/bin/sh
+
+# Tests for a bug wherein a comment just before end-of-file caused an
+# infinite loop. Thus, this test passes as long as it completes.
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+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
+
+cd $TEMPDIR
+
+activity="create program"
+cat > $TEMPDIR/foo.sps <<EOF
+COMMENT this is a comment at end of file.
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/foo.sps
+if [ $? -ne 0 ] ; then fail; fi
+
+pass;