tree/SOURCES/tree-size-field-len.patch

15 lines
801 B
Diff
Raw Permalink Normal View History

2020-09-13 18:26:12 +00:00
diff -up tree-1.7.0/tree.c.size-field-len tree-1.7.0/tree.c
--- tree-1.7.0/tree.c.size-field-len 2014-04-25 16:30:51.539046882 +0100
+++ tree-1.7.0/tree.c 2014-04-25 16:32:20.098483921 +0100
@@ -1247,8 +1247,8 @@ int psize(char *buf, off_t size)
if (hflag || siflag) {
for (idx=size<usize?0:1; size >= (usize*usize); idx++,size/=usize);
- if (!idx) return sprintf(buf, " %4d", (int)size);
- else return sprintf(buf, ((size/usize) >= 10)? " %3.0f%c" : " %3.1f%c" , (float)size/(float)usize,unit[idx]);
+ if (!idx) return sprintf(buf, " %5d", (int)size);
+ else return sprintf(buf, ((size/usize) >= 10)? " %4.0f%c" : " %4.1f%c" , (float)size/(float)usize,unit[idx]);
} else return sprintf(buf, sizeof(off_t) == sizeof(long long)? " %11lld" : " %9ld", (long long int)size);
}