This one should be able to deal with the USAGE macros a little
[oweals/busybox.git] / ls.c
diff --git a/ls.c b/ls.c
index 42b24456af018091f4ae676c35623d9b46d90cdc..44bb8cddbdc565921105637360406c4914d26609 100644 (file)
--- a/ls.c
+++ b/ls.c
@@ -50,7 +50,6 @@ enum {
 
 /************************************************************************/
 
-#include "busybox.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
@@ -58,15 +57,16 @@ enum {
 #include <dirent.h>
 #include <errno.h>
 #include <stdio.h>
-#ifdef BB_FEATURE_LS_TIMESTAMPS
-#include <time.h>
-#endif
 #include <string.h>
 #include <stdlib.h>
-
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/ioctl.h>
+#include "busybox.h"
+
+#ifdef BB_FEATURE_LS_TIMESTAMPS
+#include <time.h>
+#endif
 
 #ifndef MAJOR
 #define MAJOR(dev) (((dev)>>8)&0xff)
@@ -610,7 +610,7 @@ int list_single(struct dnode *dn)
                                break;
                        case LIST_BLOCKS:
 #ifdef BB_FEATURE_HUMAN_READABLE
-                               fprintf(stdout, "%5s ", format(dn->dstat.st_size, ls_disp_hr));
+                               fprintf(stdout, "%5s ", format(dn->dstat.st_blocks>>1, 1));
 #else
 #if _FILE_OFFSET_BITS == 64
                                printf("%4lld ", dn->dstat.st_blocks>>1);
@@ -650,9 +650,9 @@ int list_single(struct dnode *dn)
                                        fprintf(stdout, "%9s ", format(dn->dstat.st_size, ls_disp_hr));
 #else
 #if _FILE_OFFSET_BITS == 64
-                                       printf("%9lld ", dn->dstat.st_size);
+                                       printf("%9lld ", dn->dstat.st_size>>1);
 #else
-                                       printf("%9ld ", dn->dstat.st_size);
+                                       printf("%9ld ", dn->dstat.st_size>>1);
 #endif
 #endif
                                }
@@ -928,5 +928,5 @@ extern int ls_main(int argc, char **argv)
        return(status);
 
   print_usage_message:
-       usage(ls_usage);
+       show_usage();
 }