From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 19 07:57:38 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0364816A402 for ; Wed, 19 Apr 2006 07:57:38 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id E473B43D5D for ; Wed, 19 Apr 2006 07:57:32 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail12.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k3J7vNCF010885 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 19 Apr 2006 17:57:24 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.6/8.13.6) with ESMTP id k3J7vNko000884; Wed, 19 Apr 2006 17:57:23 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.6/8.13.6/Submit) id k3J7vLlD000883; Wed, 19 Apr 2006 17:57:22 +1000 (EST) (envelope-from peter) Date: Wed, 19 Apr 2006 17:57:21 +1000 From: Peter Jeremy To: Eric Anderson Message-ID: <20060419075721.GB704@turion.vk2pj.dyndns.org> References: <444515C8.3030406@centtech.com> <20060418165709.GA17705@central.0xfce3.net> <44452532.40703@centtech.com> <20060418.114933.69380798.imp@bsdimp.com> <346a80220604181102v3597a1edp3e05fa663b87e15c@mail.gmail.com> <20060418193018.GB694@turion.vk2pj.dyndns.org> <444545D3.5010405@centtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <444545D3.5010405@centtech.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: freebsd-hackers@freebsd.org, cokane@cokane.org Subject: Re: [PATCH] Fancy rc startup style RFC X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2006 07:57:38 -0000 On Tue, 2006-Apr-18 15:02:27 -0500, Eric Anderson wrote: >Peter Jeremy wrote: >>>+ padding="" >>>+ paddingsize=$(($columns - 15 - $2 - $namesize)) >>>+ until [ 0 = ${paddingsize} ]; do >>>+ padding=" $padding" >>>+ paddingsize=$(($paddingsize - 1)) >>>+ done >> >>This particular block of code appears unnecessary (since $padding is >>unused). > >I must be missing something, because I'm pretty sure it's used.. What >did I miss? Actually, I had a closer look and I was wrong, sorry. I missed the '[ $2 = 0 ]' test. The code might be more legible (and is definitely more efficient) if the above code was moved into the else clause for that test. Also '[ $2 = 0 ]' should probably be written as '[ "0$2" -eq 0 ]', or similar, so that it doesn't blow up if there is no $2. -- Peter Jeremy