Thought of another janitorial item for the list.
[oweals/busybox.git] / ls.c
diff --git a/ls.c b/ls.c
index 06e23e6123b4d8dfed28673848ecbbab86c11d3f..d8666152eaac194d03c3a7139b7da7264eb374d9 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
                                }
@@ -827,10 +827,8 @@ extern int ls_main(int argc, char **argv)
 #endif
 #ifdef BB_FEATURE_HUMAN_READABLE
                        case 'h': ls_disp_hr = 0; break;
-                       case 'k': ls_disp_hr = KILOBYTE; break;
-#else
-                       case 'k': break;
 #endif
+                       case 'k': break;
                        default:
                                goto print_usage_message;
                }