From owner-freebsd-current@FreeBSD.ORG Tue Jan 25 22:38:35 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD9CE16A4D0; Tue, 25 Jan 2005 22:38:35 +0000 (GMT) Received: from obsecurity.dyndns.org (CPE0050040655c8-CM00111ae02aac.cpe.net.cable.rogers.com [69.199.47.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59D4B43D1F; Tue, 25 Jan 2005 22:38:35 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id EEF28522B3; Tue, 25 Jan 2005 14:38:34 -0800 (PST) Date: Tue, 25 Jan 2005 14:38:34 -0800 From: Kris Kennaway To: Tim Robbins Message-ID: <20050125223834.GA28389@xor.obsecurity.org> References: <790a9fff05012509511b64e3ad@mail.gmail.com> <20050125221047.GA339@cat.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20050125221047.GA339@cat.robbins.dropbear.id.au> User-Agent: Mutt/1.4.2.1i cc: Scot Hetzel cc: freebsd-current@freebsd.org Subject: Re: uniq truncates lines > 2048 bytes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 22:38:35 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 26, 2005 at 09:10:47AM +1100, Tim Robbins wrote: > On Tue, Jan 25, 2005 at 11:51:51AM -0600, Scot Hetzel wrote: > > I noticed that if a file has lines > 2048 bytes, uniq will truncate > > the line to LINE_MAX (2048 bytes). An easy way to test this is to do > > the following: > >=20 > > cd /usr/ports/accessibility/gnomemag > > make fetch-list > test.list > > make fetch-list >> test.list > > uniq test.list > test2.list > >=20 > > test2.list should be half the size of test.list, but it is 2048 bytes. > >=20 > > I have come up with a patch to uniq that fixes this problem. > >=20 > > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D76578 >=20 > This looks good except for failure to check for realloc() returning NULL > and a few minor style problems. It may be possible to use fgetwln() > to read lines instead of getwc() + realloc() etc., but this function is > new and peculiar to FreeBSD. >=20 > I was planning on going through all text-processing utilities in the base > system some time and either fixing line length problems or documenting th= em, > similar to what I did with multibyte character support. I may make a start > at that today. If someone could fix comm(1) that would be a big help for me, because I have a local hack I have to carry around in all of my local package source trees. Kris --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFB9spqWry0BWjoQKURArp7AJ9PwxRD/RL6KTQif4S5wBeXnV591QCghR5q oR7WpSUXuHAFfxWcs89oNOc= =funr -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--