[PATCH] less: fix display of line numbers

Ron Yorston rmy at frippery.org
Sat Jul 18 15:18:28 UTC 2015


walter harms wrote:
>you can remove the else if you turn the compare on its head.
>may be this helps so save a few bytes.

It doesn't make any difference to the binary though it does make the
source a bit tidier.

>> +		if (n > 9999999 && MAXLINES > 9999999) {
>could you explain in 1 line why the MAXLINES test is needed ?

It isn't needed, but the default configuration sets MAXLINES to
9999999 so the compiler can optimise away the code in the if.  It
saves about 20 bytes.

>> +		if (option_mask32 & FLAG_N) {
>> +			print_lineno(buffer[i]);
>> +		}
>
>i guess you can remove the {}

Yes, sorry, that's my preferred style but it's not BusyBox's.

Ron


More information about the busybox mailing list