Fix bug in IsTopLevel.

This commit is contained in:
David F. Skoll
2008-10-05 14:29:03 -04:00
parent 9f2ae1773c
commit 30a385a7bb
4 changed files with 12 additions and 1 deletions

View File

@@ -723,7 +723,7 @@ static void DestroyCache(CachedFile *cf)
/***************************************************************/
int TopLevel(void)
{
return !IStackPtr;
return IStackPtr <= 1;
}
/***************************************************************/

3
tests/runinc.rem Normal file
View File

@@ -0,0 +1,3 @@
set s shell("echo 3")
run on
set s shell("echo 3")

6
tests/runtest.rem Normal file
View File

@@ -0,0 +1,6 @@
run off
set a shell("echo 2")
run on
set a shell("echo 2")
run off
include ../tests/runinc.rem

View File

@@ -67,6 +67,8 @@ echo "Sort Test" >> ../tests/test.out
(echo "REM AT 12:00 MSG Untimed"; echo "REM MSG Timed") | ../src/remind -gaaa - 1 Jan 2000 >> ../tests/test.out 2>&1
(echo "REM AT 12:00 MSG Untimed"; echo "REM MSG Timed") | ../src/remind -gaaad - 1 Jan 2000 >> ../tests/test.out 2>&1
../src/remind ../tests/runtest.rem >> ../tests/test.out 2>&1
cmp -s ../tests/test.out ../tests/test.cmp
if [ "$?" = "0" ]; then
echo "Remind: Acceptance test PASSED"