From 3619192e3f1055f0e502977323044b43b9652159 Mon Sep 17 00:00:00 2001 From: Fabian Zickgraf Date: Thu, 24 Nov 2022 12:20:22 +0100 Subject: [PATCH] Handle READ_GAP_ROOT as an "outer loop" in the sense of the message "you can 'quit;' to quit to outer loop" in break loops. I.e. continue in READ_GAP_ROOT even if `UserHasQuit`. --- src/streams.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/streams.c b/src/streams.c index 02b0d1aeaeb..b41fada35eb 100644 --- a/src/streams.c +++ b/src/streams.c @@ -407,8 +407,13 @@ Int READ_GAP_ROOT ( const Char * filename ) if (OpenInput(&input, path)) { while (1) { ExecStatus status = ReadEvalCommand(0, &input, 0, 0); - if (STATE(UserHasQuit) || STATE(UserHasQUIT)) + if (STATE(UserHasQuit)) { + FlushRestOfInputLine(&input); + STATE(UserHasQuit) = FALSE; + } + else if (STATE(UserHasQUIT)) { break; + } if (status == STATUS_RETURN) { Pr("'return' must not be used in file", 0, 0); }