Date: Wed, 19 Apr 2006 17:57:21 +1000 From: Peter Jeremy <peterjeremy@optushome.com.au> To: Eric Anderson <anderson@centtech.com> Cc: freebsd-hackers@freebsd.org, cokane@cokane.org Subject: Re: [PATCH] Fancy rc startup style RFC Message-ID: <20060419075721.GB704@turion.vk2pj.dyndns.org> In-Reply-To: <444545D3.5010405@centtech.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060419075721.GB704>
