From owner-freebsd-current Sat Jun 15 21:41:25 2002 Delivered-To: freebsd-current@freebsd.org Received: from creme-brulee.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158]) by hub.freebsd.org (Postfix) with ESMTP id 6FBA437B40D for ; Sat, 15 Jun 2002 21:41:20 -0700 (PDT) Received: from shumai.marcuscom.com (marcus@shumai.marcuscom.com [192.168.1.4]) by creme-brulee.marcuscom.com (8.12.3/8.12.3) with ESMTP id g5G4dgB4009160 for ; Sun, 16 Jun 2002 00:39:42 -0400 (EDT) (envelope-from marcus@FreeBSD.org) Subject: [PATCH] sed is broken in -CURRENT From: Joe Marcus Clarke To: current@FreeBSD.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-JlOd5wYurC/dDTJc6eFy" X-Mailer: Ximian Evolution 1.0.7 Date: 16 Jun 2002 00:41:42 -0400 Message-Id: <1024202502.81450.13.camel@shumai.marcuscom.com> Mime-Version: 1.0 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-JlOd5wYurC/dDTJc6eFy Content-Type: multipart/mixed; boundary="=-f5cnswLhgUZJD4pdt9ez" --=-f5cnswLhgUZJD4pdt9ez Content-Type: text/plain Content-Transfer-Encoding: quoted-printable After the recent round of -i fixes to sed, certain ports will no longer make configure (gaim being a prime example). The problem is that mf_fgets() is unnecessarily overwriting sp->len. The attached patch corrects the problem while still allowing -i to work on multiple files. As a ports committer, I can't do anything but let you guys (and gals) know. Thanks. Joe --=-f5cnswLhgUZJD4pdt9ez Content-Disposition: attachment; filename=main.c.diff Content-Type: text/x-patch; name=main.c.diff; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable diff -u -r1.23 main.c --- usr.bin/sed/main.c 2002/06/14 02:20:05 1.23 +++ usr.bin/sed/main.c 2002/06/16 04:38:31 @@ -315,7 +315,8 @@ firstfile =3D 1; } =20 - sp->len =3D 0; + if (lastline) + sp->len =3D 0; for (;;) { if (f !=3D NULL && (c =3D getc(f)) !=3D EOF) { (void)ungetc(c, f); --=-f5cnswLhgUZJD4pdt9ez-- --=-JlOd5wYurC/dDTJc6eFy Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQA9DBcGb2iPiv4Uz4cRAiGQAJ44gVxR3+RKW1cHissaZ8gsJg7icgCfRqUP tTJZPgi/QTg0/axCh9rWroE= =zZmA -----END PGP SIGNATURE----- --=-JlOd5wYurC/dDTJc6eFy-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message