NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/41764: ksh has suffered serious regressions in the past few years
The following reply was made to PR bin/41764; it has been noted by GNATS.
From: "Greg A. Woods" <woods%planix.com@localhost>
To: NetBSD GNATS <gnats-bugs%NetBSD.org@localhost>
Cc:
Subject: Re: bin/41764: ksh has suffered serious regressions in the past few
years
Date: Thu, 23 Jul 2009 16:13:54 -0400
--pgp-sign-Multipart_Thu_Jul_23_16:13:54_2009-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Thanks for taking the time to review some of these changes!
At Thu, 23 Jul 2009 16:00:06 +0000 (UTC), Robert Elz
<kre%munnari.OZ.AU@localhost> wr=
ote:
Subject: Re: bin/41764: ksh has suffered serious regressions in the past fe=
w years=20
> =20
> I haven't looked at all of this, but I guarantee this isn't
> what you want ...
> =20
> | + while (nest > 0 && (c =3D *s)) {
> | + if (c =3D=3D '\\') {
> | + s++;
> | + s++;
> | + continue;
> | + }
> =20
> The second s++; should be something like
> =20
> if (*s++ =3D=3D '\0')
> return NULL;
> =20
> String pointers that increment twice with no testing are usually
> just a big "BITE ME HERE" sign for bugs... (this case certainly is.)
Yes, indeed. My patch restores verbatim the change from edit.c rev 1.7
The code as it was existed in NetBSD's 1.6.x and 2.0.x, and 2.1, and I
don't recall anyone complaining of any actual crashes involving it.
However your suggested fix seems appropriate and necessary.
> And this is just plain ugly ...
> =09
> | + if ((cp =3D find_match(&s[1], '{')))
> | + s =3D ++cp;
> =20
> if find_match(s+1, ...) then s =3D cp+1 - the forms used are just wacko.
Indeed.
> (no position taken on whether the if should have a !=3D NULL explicit te=
st.)
Not having it seems in keeping with the style used in the rest of the
program....
--=20
Greg A. Woods
Planix, Inc.
<woods%planix.com@localhost> +1 416 218-0099
http://www.planix.com/
--pgp-sign-Multipart_Thu_Jul_23_16:13:54_2009-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (NetBSD)
iD8DBQBKaMSCZn1xt3i/9H8RAlluAJ9Te9iDNMNsaFdXmavXUQV7TVeJkwCgrEt3
gFB2Xz+1tBbD2oWfdlqWf9A=
=BGzf
-----END PGP SIGNATURE-----
--pgp-sign-Multipart_Thu_Jul_23_16:13:54_2009-1--
Home |
Main Index |
Thread Index |
Old Index