svn commit: r257602 - user/cperciva/panicmail

Jilles Tjoelker jilles at stack.nl
Fri Nov 8 10:57:18 UTC 2013


On Thu, Nov 07, 2013 at 11:34:15PM +0100, Jeremie Le Hen wrote:
> On Mon, Nov 04, 2013 at 03:00:45AM +0000, Colin Percival wrote:
> > Author: cperciva
> > Date: Mon Nov  4 03:00:44 2013
> > New Revision: 257602
> > URL: http://svnweb.freebsd.org/changeset/base/257602

> > Log:
> >   Change
> >   	local tmpfile=`mktemp` || exit 1
> >   into
> >   	local tmpfile
> >   	tmpfile=`mktemp` || exit 1
> >   since the former is parsed as "local || exit 1" and loses the exit code
> >   from mktemp.

> >   Submitted by:	jilles

> Out of curiosity, is this brokenness of local mandated by the standard?

local is not in any standard, but this behaviour of command
substitutions has been mandated for a long time. If there is a command
word, the exit status is the exit status of that command word, not the
exit status of a command substitution. On the other hand, in the
original Bourne shell, it was possible to do things like
  set -- `getopt ab: $*`; errcode=$?

Given that it already changed once, I think changing it back would be
inappropriate and unlikely.

-- 
Jilles Tjoelker


More information about the svn-src-user mailing list