Subject: CVS commit: src/bin/sh
To: None <source-changes@NetBSD.org>
From: Charles M. Hannum <mycroft@netbsd.org>
List: source-changes
Date: 06/30/2004 09:32:38
Module Name:	src
Committed By:	mycroft
Date:		Wed Jun 30 09:32:38 UTC 2004

Modified Files:
	src/bin/sh: eval.c

Log Message:
Make "set -e" once again provide the behavior documented in the man page,
which was unnecessarily changed in revision 1.50 while fixing other bugs.
That is, exit the shell if the last command in a || or && compound statement
is not short-circuited, and exits with a false status.  I.e., the following
will cause the shell to exit:

  set -e
  false || false

While this is not the prescribed behavior in SUSv3, it is what our man page
documents, and it is what all of the following implementations do:

  NetBSD /bin/ksh (pdksh)
  bash
  zsh
  Solaris 9 /bin/sh
  Solaris 9 /usr/xpg4/bin/sh
  Solaris 9 /usr/bin/ksh
  Tru64 /bin/sh
  HP/UX 11 /bin/sh

The "standard" seems to be wrong in this instance.


To generate a diff of this commit:
cvs rdiff -r1.78 -r1.79 src/bin/sh/eval.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.