[PATCH] Fancy rc startup style RFC

Peter Jeremy peterjeremy at optushome.com.au
Wed Apr 19 07:57:38 UTC 2006


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


More information about the freebsd-hackers mailing list