Date: Wed, 4 Jun 2003 11:01:25 +1000 From: Tim Robbins <tjr@FreeBSD.ORG> To: audit@FreeBSD.org Subject: Re: conf/51256: chkgrp should make sure the file is newline terminated Message-ID: <20030604110125.A41509@dilbert.robbins.dropbear.id.au> In-Reply-To: <20030527142122.GG513@straylight.oblivion.bg>; from roam@ringlet.net on Tue, May 27, 2003 at 05:21:22PM %2B0300 References: <200304220700.h3M70CM3058589@freefall.freebsd.org> <20030527084242.GB513@straylight.oblivion.bg> <20030527235525.A47880@dilbert.robbins.dropbear.id.au> <20030527142122.GG513@straylight.oblivion.bg>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 27, 2003 at 05:21:22PM +0300, Peter Pentchev wrote: > On Tue, May 27, 2003 at 11:55:25PM +1000, Tim Robbins wrote: > > On Tue, May 27, 2003 at 11:42:42AM +0300, Peter Pentchev wrote: > > > > > Could somebody take a look at this PR and the patch (quoted below), and > > > see if there's anything wrong with it or it may be committed? > > [...] > > > > if ((line = fgetln(gf, &len)) == NULL) > > > > break; > > > > + if (len > 0 && line[len - 1] != '\n' && line[len - 1] != '\r') { > > > > + warnx("%s: line %d: no newline character", gfn, n); > > > > + e++; > > > > + } > > [...] > > > > I think that it's unnecessary (and incorrect) to check for a '\r' character > > at the end of the line. > > Okay, this might have been a bad habit of processing files that came > from Over There ;) So.. how about the patch with only the '\n' check, > then? Yes, it looks fine now. Sorry for taking so long to get back to you about this. Tim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030604110125.A41509>