NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/49595: unset built-in exits with failure if parameter not set
The following reply was made to PR bin/49595; it has been noted by GNATS.
From: William Ahern <william%25thandclement.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/49595: unset built-in exits with failure if parameter not set
Date: Mon, 10 Oct 2016 11:22:24 -0700
On Mon, Oct 10, 2016 at 01:15:00AM +0000, David Holland wrote:
<snip>
> On Thu, Jan 22, 2015 at 04:10:00AM +0000, william%25thandclement.com@localhost wrote:
<snip>
> > >How-To-Repeat:
> > Following script should print "OK".
> >
> > #!/bin/sh
> > FOO=bar
> > unset FOO
> > set -e
> > unset FOO
> > printf "OK\n"
>
> ok, all this is about sh, but...
>
> > >Fix:
> > Remove the following from c_unset in ksh/c_sh.c:
> >
> > if (!(vp->flag & ISSET))
> > ret = 1;
>
> ...that's about ksh.
>
> So are you talking about sh or ksh? Currently, sh does not exhibit
> this behavior, but ksh does.
Oops. I didn't realize /bin/sh and /bin/ksh used different sources, and I
analyzed and created a patch for the wrong implementation.
This bug was fixed in sh in revision 1.43
http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/sh/var.c.diff?r1=1.42&r2=1.43&only_with_tag=MAIN&f=h
but it never made it into the 6.1 branch. This issue is fixed in 7.0. Sorry
for the noise.
Home |
Main Index |
Thread Index |
Old Index