From 79e615c130eb0eaa23c7c220a51c3cf00e17b3a6 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 25 May 2005 04:54:54 +0000 Subject: [PATCH] Handle case of a lookup table as the active file. --- src/ChangeLog | 5 +++++ src/get.c | 4 +++- tests/command/match-files.sh | 39 ++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index ac2affb8..9667a24e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +Tue May 24 21:52:55 2005 Ben Pfaff + + * get.c: (mtf_processing) Handle case of a lookup table as the + active file. Thanks to John Darrington for reporting this bug. + Wed May 25 10:27:02 WST 2005 John Darrington * alloc.c alloc.h: (xcalloc) changed signature to imitate the diff --git a/src/get.c b/src/get.c index 0658ab24..fd949221 100644 --- a/src/get.c +++ b/src/get.c @@ -1201,7 +1201,9 @@ mtf_processing (struct ccase *c, void *mtf_) bool read_active_file; assert (mtf->head != NULL); - assert (mtf->head->type == MTF_FILE); + if (mtf->head->type == MTF_TABLE) + return 1; + do { struct mtf_file *min_head, *min_tail; /* Files with minimum BY values. */ diff --git a/tests/command/match-files.sh b/tests/command/match-files.sh index 77fb3ce5..bb472939 100755 --- a/tests/command/match-files.sh +++ b/tests/command/match-files.sh @@ -205,4 +205,43 @@ A B C D E F EOF if [ $? -ne 0 ] ; then fail ; fi +# Test bug handling TABLE from active file found by John Darrington. +name="active-table" +activity="create $name.pspp" +cat > $name.pspp </dev/null 2>&1 +if [ $? -ne 0 ] ; then no_result ; fi + +activity="check $name output" +diff -b -w -B - pspp.list <