From owner-freebsd-audit Sun Aug 12 17:18:22 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id AF81F37B405; Sun, 12 Aug 2001 17:18:19 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f7D0dE229839; Sun, 12 Aug 2001 20:39:14 -0400 (EDT) (envelope-from mike) Date: Sun, 12 Aug 2001 20:39:14 -0400 From: Mike Barcroft To: Akinori MUSHA Cc: green@FreeBSD.org, audit@FreeBSD.org Subject: Re: adding -P option to pkg_delete(1) Message-ID: <20010812203914.C29363@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , Akinori MUSHA , green@FreeBSD.org, audit@FreeBSD.org References: <86elqphctp.wl@archon.local.idaemons.org> <86d761hijs.wl@archon.local.idaemons.org> <20010812140750.B29132@coffee.q9media.com> <86snex15o4.wl@archon.local.idaemons.org> <20010812164843.A29363@coffee.q9media.com> <86ofpl0yq8.wl@archon.local.idaemons.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <86ofpl0yq8.wl@archon.local.idaemons.org>; from knu@iDaemons.org on Mon, Aug 13, 2001 at 06:12:15AM +0900 Organization: The FreeBSD Project Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Aug 13, 2001 at 06:12:15AM +0900, Akinori MUSHA wrote: > > Neither do I. Mostly because you could be accessing memory before > > filename starts. > > No, no. If (p - filename < 2) is false, the rest is not evaluated. > It would be more than just "don't like" if the code had such a > terrible flaw. ;) > > The reason why I don't like it is because it goes to extremes for > performance, to result in less readable, inflexible code. I'm quite sure it has problems, it was just an example of how it could be achieved with traversing filename a half-dozen times. But ofcourse Brian is correct, we should just use regex instead of trying to reinvent the wheel. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message