From owner-cvs-src@FreeBSD.ORG Sun Nov 20 16:43:53 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3D1D16A41F; Sun, 20 Nov 2005 16:43:53 +0000 (GMT) (envelope-from grog@lemis.com) Received: from ext-gw.lemis.com (ext-gw.lemis.com [150.101.14.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0159643D62; Sun, 20 Nov 2005 16:43:52 +0000 (GMT) (envelope-from grog@lemis.com) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by ext-gw.lemis.com (Postfix) with ESMTP id A73A5131BAD; Mon, 21 Nov 2005 03:13:51 +1030 (CST) Received: from eucla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by wantadilla.lemis.com (Postfix) with ESMTP id 1C42884AC7; Mon, 21 Nov 2005 03:13:51 +1030 (CST) Received: by eucla.lemis.com (Postfix, from userid 1004) id EC52386C9F; Sun, 20 Nov 2005 17:43:47 +0100 (CET) Date: Sun, 20 Nov 2005 17:43:47 +0100 From: Greg 'groggy' Lehey To: Colin Percival Message-ID: <20051120164347.GA871@eucla.lemis.com> References: <200511200050.jAK0oUbB059874@repoman.freebsd.org> <20051120080850.GD856@eucla.lemis.com> <438046F2.60003@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <438046F2.60003@freebsd.org> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/portsnap/make_index make_index.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2005 16:43:53 -0000 On Sunday, 20 November 2005 at 1:50:42 -0800, Colin Percival wrote: > Greg 'groggy' Lehey wrote: >> On Sunday, 20 November 2005 at 0:50:30 +0000, Colin Percival wrote: >>> Log: >>> An empty file does not have a positive number of lines. >> >> Yes it does. It's 0, not -0. > > As a mathematician, I must insist that 0 = -0 and is neither > positive nor negative. :-) Hmm, interesting. I've obviously forgotten too much mathematics. I've also almost forgotten ones'-complement machines, but I'm pretty sure that it's correct to say in computers that (+)0 is positive. On the ones'-complement machines I knew, -0 was also (usually) negative. >>> Make sure that the number of lines read is non-zero before in >>> order to avoid dumping core. >> >> This is a different (and presumably correct) test. > > The correct test is actually to verify that the number of lines > is positive, but while we cannot assume this (as I originally > did), we can assume that the number of lines is non-negative > (and all non-negative non-zero values are positive). Don't spoil a good story by sticking to facts :-) Greg -- See complete headers for address and phone numbers