INPUT PROGRAM: Don't break out of INPUT PROGRAM on interactive error.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 24 Nov 2012 22:14:16 +0000 (14:14 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 24 Nov 2012 22:14:16 +0000 (14:14 -0800)
Until now, any erroneous command typed within an input program at an
interactive command prompt implicitly "broke out" of the input program,
causing confusing behavior.  This commit fixes the problem: commands
following an erroneous command within INPUT PROGRAM continue to be part of
the input program.

Bug #33419.
Reported by John Darrington.

src/language/data-io/inpt-pgm.c

index ccd53be04e4199913635d1568aa4af774459e36f..afeb832643f4cda772964aad6707652e07a9a0fe 100644 (file)
@@ -112,7 +112,9 @@ cmd_input_program (struct lexer *lexer, struct dataset *ds)
           emit_END_CASE (ds, inp);
           saw_END_CASE = true;
         }
-      else if (cmd_result_is_failure (result) && result != CMD_FAILURE)
+      else if (cmd_result_is_failure (result)
+               && result != CMD_FAILURE
+               && lex_get_error_mode (lexer) != LEX_ERROR_INTERACTIVE)
         {
           if (result == CMD_EOF)
             msg (SE, _("Unexpected end-of-file within INPUT PROGRAM."));