From: Ben Pfaff Date: Fri, 1 Dec 2006 06:02:35 +0000 (+0000) Subject: Properly handle empty DO REPEAT...END REPEAT block. Fixes bug #18407. X-Git-Tag: v0.6.0~677 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=136d243060f851e01ef46e72b9b554059b5ae544;p=pspp-builds.git Properly handle empty DO REPEAT...END REPEAT block. Fixes bug #18407. Thanks to John Darrington for reporting this bug. --- diff --git a/src/language/control/ChangeLog b/src/language/control/ChangeLog index 50707bd4..17d3b510 100644 --- a/src/language/control/ChangeLog +++ b/src/language/control/ChangeLog @@ -1,3 +1,9 @@ +Thu Nov 30 22:01:27 2006 Ben Pfaff + + * repeat.c (do_repeat_read): Properly handle empty DO REPEAT...END + REPEAT block. Fixes bug #18407. Thanks to John Darrington for + reporting this bug. + Sat Oct 28 16:18:48 WST 2006 John Darrington * repeat.c: Eliminated references to extern variable getl_buf. diff --git a/src/language/control/repeat.c b/src/language/control/repeat.c index 796c6e93..951c0094 100644 --- a/src/language/control/repeat.c +++ b/src/language/control/repeat.c @@ -549,6 +549,8 @@ do_repeat_read (struct getl_interface *b, struct string *output) if (block->loop_idx >= block->loop_cnt) return false; block->cur_line = block->first_line; + if (block->cur_line == NULL) + return false; } line = block->cur_line; diff --git a/tests/ChangeLog b/tests/ChangeLog index d5d2305b..e6696c45 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +Thu Nov 30 22:01:57 2006 Ben Pfaff + + * automake.mk: Add new test. + + * tests/bugs/empty-do-repeat: New test, for bug #18407. + Wed Nov 22 06:28:04 2006 Ben Pfaff * tests/bugs/signals.sh: Fix race condition. diff --git a/tests/automake.mk b/tests/automake.mk index ebefbf48..54d7c326 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -85,6 +85,7 @@ TESTS = \ tests/bugs/curtailed.sh \ tests/bugs/data-crash.sh \ tests/bugs/double-frequency.sh \ + tests/bugs/empty-do-repeat.sh \ tests/bugs/get.sh \ tests/bugs/examine-1sample.sh \ tests/bugs/examine-missing.sh \