bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOF at PS2


From: Grisha Levit
Subject: Re: EOF at PS2
Date: Fri, 23 Jun 2023 19:11:16 -0400

On Fri, May 26, 2023, 17:44 Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 4/26/23 5:38 PM, Grisha Levit wrote:
> > A few issues with EOF being received at PS2:
>
> I finally had a chance to check out the ksh88 behavior on a Solaris 10 VM.
> It's pretty bizarre, but it does point to some improvements when ignoreeof
> is enabled. It seems like the POSIX committee wanted the ksh88 behavior
> without the weird aspects. I didn't check ksh93.
>
> I think we can have bash honor ignoreeof and not exit after delimiting the
> token or command while not acting quite as bizarrely as ksh88.


I think the new behavior is quite reasonable. Though it does need
something to allow the exit builtin to work even with ignoreeof, like
---
diff --git a/eval.c b/eval.c
index 8337a275..f91a09fe 100644
--- a/eval.c
+++ b/eval.c
@@ -185,7 +185,7 @@ reader_loop (void)
            }
          if (EOF_Reached && interactive && ignoreeof &&
parse_and_execute_level == 0)
            {
- if (handle_ignoreeof (1))
+ if (code != EXITBLTIN && handle_ignoreeof (1))
                EOF_Reached = 0;
            }
        }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]