From owner-freebsd-current Tue Mar 20 0:37:20 2001 Delivered-To: freebsd-current@freebsd.org Received: from peorth.iteration.net (peorth.iteration.net [208.190.180.178]) by hub.freebsd.org (Postfix) with ESMTP id 59F8537B742; Tue, 20 Mar 2001 00:37:15 -0800 (PST) (envelope-from keichii@peorth.iteration.net) Received: by peorth.iteration.net (Postfix, from userid 1001) id 646CE59283; Tue, 20 Mar 2001 02:36:58 -0600 (CST) Date: Tue, 20 Mar 2001 02:36:58 -0600 From: "Michael C . Wu" To: thinker Cc: freebsd-current@freebsd.org, imp@freebsd.org Subject: Re: /bin/ls mb patch again Message-ID: <20010320023657.B47174@peorth.iteration.net> Reply-To: "Michael C . Wu" Mail-Followup-To: "Michael C . Wu" , thinker , freebsd-current@freebsd.org, imp@freebsd.org References: <20010320163153.A14341@hell.branda.to> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010320163153.A14341@hell.branda.to>; from thinker@branda.to on Tue, Mar 20, 2001 at 04:31:53PM +0000 X-PGP-Fingerprint: 5025 F691 F943 8128 48A8 5025 77CE 29C5 8FA1 2E20 X-PGP-Key-ID: 0x8FA12E20 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Mar 20, 2001 at 04:31:53PM +0000, thinker scribbled: | Sorry, I forget to diff with -u. I send the patch again. | Following is mb patch file for /bin/ls. | | ---------- begin --------- | --- util.c.orig Sun Mar 18 16:35:12 2001 | +++ util.c Tue Mar 20 16:11:37 2001 | + if (isprint(c)) { | + while(sz--) | + *ri++ = *p++; | + } else { | + p += sz; | + while(sz--) | + *ri++ = '?'; Warner: Thinker thinks that memset() is too costly to use here to modify one or two bytes. I agreed with him in that filenames can't be that long to justify the memset() overhead. However, with today's CPU power, I think memset()'s overhead will only be noticeable with a large directory filled with data. Please tell Thinker what you think. (DES: please resist the ironies and the -chat post ;) ) -- +-----------------------------------------------------------+ | keichii@iteration.net | keichii@freebsd.org | | http://iteration.net/~keichii | Yes, BSD is a conspiracy. | +-----------------------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message