NetBSD-Bugs archive

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

bin/45613: /bin/sh: 'set -e' + 'if eval false' problem



>Number:         45613
>Category:       bin
>Synopsis:       /bin/sh: 'set -e' + 'if eval false' problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 14 11:35:00 +0000 2011
>Originator:     Aleksey Cheusov
>Release:        NetBSD 5.99.56
>Organization:
>Environment:
System: NetBSD asrock.chizhovka.net 5.99.56 NetBSD 5.99.56 (GENERIC) #2: Mon 
Nov 7 21:06:55 FET 2011 
cheusov%asrock.chizhovka.net@localhost:/srv/obj-current/sys/arch/amd64/compile/GENERIC
 amd64
Architecture: x86_64
Machine: amd64
>Description:
The following code should print 'Test passed' but doesn't.
I consider this problem as a serious regression since 5.1 and 5.0.

   0 cheusov>cat ~/tmp/1.sh
   #!/bin/sh

   set -e

   if eval false; then
       echo 'This should not happen'
   fi

   echo 'Test passed'
   0 cheusov>/bin/sh ~/tmp/1.sh
   1 cheusov>

>Fix:
http://www.freebsd.org/cgi/query-pr.cgi?pr=134881&cat=



Home | Main Index | Thread Index | Old Index