From owner-freebsd-bugs Wed Apr 19 22:18:19 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from orion.ac.hmc.edu (Orion.AC.HMC.Edu [134.173.32.20]) by hub.freebsd.org (Postfix) with ESMTP id 1BBFA37B816 for ; Wed, 19 Apr 2000 22:18:13 -0700 (PDT) (envelope-from brdavis@orion.ac.hmc.edu) Received: (from brdavis@localhost) by orion.ac.hmc.edu (8.8.8/8.8.8) id WAA22102; Wed, 19 Apr 2000 22:17:30 -0700 (PDT) Date: Wed, 19 Apr 2000 22:17:30 -0700 From: Brooks Davis To: Mike Heffner Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/18103: [PATCH] FTP_PASSIVE_MODE and libftpio Message-ID: <20000419221730.A16110@orion.ac.hmc.edu> References: <200004200500.WAA94523@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre4i In-Reply-To: <200004200500.WAA94523@freefall.freebsd.org>; from mheffner@mailandnews.com on Wed, Apr 19, 2000 at 10:00:04PM -0700 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, Apr 19, 2000 at 10:00:04PM -0700, Mike Heffner wrote: > Maybe it should do the comparison without depending on the string case? > > How about this: > > { > char *cp; > cp = getenv("FTP_PASSIVE_MODE"); > if (cp && strncasecmp(cp, "YES", 3)==0) > ftpPassive(fp, TRUE); > else > ftpPassive(fp, FALSE); > } Why compleatly change the behavior of this variable? Going from "if(defined) then true" to "if("YES") then true" is definatly a POLA violation. The obvious fix to allow NO to mean NO makes more sense. { char *cp; cp = getenv("FTP_PASSIVE_MODE"); if (cp && strncasecmp(cp, "NO", 3)==0) ftpPassive(fp, FALSE); else ftpPassive(fp, TRUE); } -- Brooks -- Any statement of the form "X is the one, true Y" is FALSE. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message