From owner-cvs-all Wed Jan 2 8:47:23 2002 Delivered-To: cvs-all@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 2504337B417; Wed, 2 Jan 2002 08:47:13 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id g02GieV98232; Wed, 2 Jan 2002 17:44:41 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Garance A Drosihn Cc: Stephen McKay , Julian Elischer , John Baldwin , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Julian Elischer , Greg Lehey Subject: Re: cvs commit: src/share/man/man3 queue.3 In-Reply-To: Your message of "Wed, 02 Jan 2002 10:52:44 EST." Date: Wed, 02 Jan 2002 17:44:40 +0100 Message-ID: <98230.1009989880@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message , Garance A Drosihn writes: >>The man page should explicitly state that p is undefined after the loop >>completes unless the user breaks out. Oh, and explicitly stating that >>it is OK to break out at all might be nice too. :-) Agree and agree. >Perhaps I am missing something, but this issue seems pretty simple to >me. What's wrong with: > > keyp = NULL; > TAILQ_FOREACH(p, &list, p_next) { > if (some_test_on(p)) { > keyp = p; > break; /* optional */ > } > } > >and then using 'keyp' outside the loop? Again: agree. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message