/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013, 2014 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
result = lex_end_of_command (lexer);
lex_discard_rest_of_command (lexer);
- while (lex_token (lexer) == T_ENDCMD)
- lex_get (lexer);
+ if (result != CMD_EOF && result != CMD_FINISH)
+ while (lex_token (lexer) == T_ENDCMD)
+ lex_get (lexer);
if (opened)
text_item_submit (text_item_create (TEXT_ITEM_COMMAND_CLOSE,
])
AT_CLEANUP
+dnl Tests for a bug where FINISH or EXIT wasn't executed until the lexer
+dnl read the first token of the next command.
+dnl
+dnl (If this reecurs, the the test will run forever.)
+AT_SETUP([FINISH executes immediately])
+AT_CHECK([(echo "FINISH."; while :; do echo; done) | pspp])
+AT_CLEANUP
+
AT_BANNER([ERASE])
AT_SETUP([ERASE -- safer mode])