Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2003 13:40:23 -0800 (PST)
From:      Ryan Sommers <ryans@gamersimpact.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   [PATCH] Re: bin/59320: Using ls -h (on FBSD 5.x) causes unaligned formatting
Message-ID:  <200311212140.hALLeNfn019312@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

The following reply was made to PR bin/59320; it has been noted by GNATS.

From: Ryan Sommers <ryans@gamersimpact.com>
To: freebsd-gnats-submit@FreeBSD.org, mbadolato@cybernox.com
Cc:  
Subject: [PATCH] Re: bin/59320: Using ls -h (on FBSD 5.x) causes unaligned formatting
Date: Fri, 21 Nov 2003 15:30:50 -0600

 Patch to fix formatting. I don't see why the "-1" was added, but taking it out 
 of the printing seems to do the trick, I tested it on a few different 
 directory structures and seems to work.
 
 --- /usr/src/bin/ls/print.c	Wed Nov 19 21:04:58 2003
 +++ /usr/src/bin/ls/print.c	Fri Nov 21 15:01:25 2003
 @@ -626,7 +626,7 @@
  		if (dbytes == 0)
  			(void)printf("%*s ", (u_int)width, "0B");
  		else
 -			(void)printf("%*.*f%c ", (u_int)width - 1,
 +			(void)printf("%*.*f%c ", (u_int)width,
  			    dbytes > 10 ? 0 : 1, dbytes, "BKMGTPE"[unit]);
  	} else
  		(void)printf("%*jd ", (u_int)width, bytes);
 
 -- 
 Ryan "leadZERO" Sommers
 Gamer's Impact President
 ryans@gamersimpact.com
 ICQ: 1019590
 AIM/MSN: leadZERO
 
 -= http://www.gamersimpact.com =-
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311212140.hALLeNfn019312>