Subject: bin/11542: ksh/sh -e bug in for loops
To: None <>
From: None <>
List: netbsd-bugs
Date: 11/21/2000 12:18:14
>Number:         11542
>Category:       bin
>Synopsis:       ksh/sh -e bug in for loops
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 21 12:18:00 PST 2000
>Originator:     Dan Winship
>Release:        current
System: NetBSD 1.4X NetBSD 1.4X (MONKEY) #1: Thu Jun 1 10:59:26 EDT 2000 i386

	A shell running with "-e" will exit if a command in an && list
	inside a for loop fails. (It behaves correctly inside a while
	loop, or outside of a loop.)
% cat
set -e

for x in 1; do
    false && true
echo "reached end"

% sh
% ksh
% bash
reached end

	I looked at the code (sh/eval.c), got some ideas about
	possible fixes, then looked at the CVS log and decided to run