From 69e0980edaca197e64e1aba26f6a72251e4dd479 Mon Sep 17 00:00:00 2001 From: Milana <94888u@gmail.com> Date: Sun, 18 Aug 2024 01:47:19 +0200 Subject: [PATCH] fix the message displayed when trying to do ^D inside interactive mode with both -n and -o ignoreeof flags --- y.tab.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/y.tab.c b/y.tab.c index 793686e7..6d800a18 100644 --- a/y.tab.c +++ b/y.tab.c @@ -8669,8 +8669,16 @@ handle_eof_input_unit () { if (eof_encountered < eof_encountered_limit) { - fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), - login_shell ? "logout" : "exit"); + if (executing) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + } + else + { + fprintf(stderr, "No executing, enter EOF %d more times in row to leave the shell.\n", + eof_encountered_limit - eof_encountered); + } eof_encountered++; /* Reset the parsing state. */ last_read_token = current_token = '\n'; -- 2.46.0