Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Loops and pipes



On Mon, Aug 3, 2026 at 3:37 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> I don't think that trying to make "break" and "continue" work in such a context would be a good idea.
>
> ksh works like Zsh ("break" triggers no error and has the same effect as "return") but bash signals an error

Making it an error is quite simple:

diff --git a/Src/exec.c b/Src/exec.c
index 5f849db63..2e6684c96 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1258,6 +1258,7 @@ entersubsh(int flags, struct entersubsh_ret *retp)
        clearjobtab(monitor);
     get_usage();
     forklevel = locallevel;
+    loops = 0;
 }

 /* execute a string */




Messages sorted by: Reverse Date, Date, Thread, Author