date: -R shouldn't use locale
[oweals/busybox.git] / coreutils / ls.c
index 909f4d54e8332827ad799eeef3e40048ab0e5f17..960c161b033eb4e2734caea9ebd153c4cef41376 100644 (file)
@@ -574,7 +574,7 @@ static int list_single(struct dnode *dn)
                        column += printf("%7ld ", (long) dn->dstat.st_ino);
                        break;
                case LIST_BLOCKS:
-                       column += printf("%4"OFF_FMT" ", (off_t) dn->dstat.st_blocks >> 1);
+                       column += printf("%4"OFF_FMT"d ", (off_t) dn->dstat.st_blocks >> 1);
                        break;
                case LIST_MODEBITS:
                        column += printf("%-10s ", (char *) bb_mode_string(dn->dstat.st_mode));
@@ -604,7 +604,7 @@ static int list_single(struct dnode *dn)
                                        column += printf("%9s ",
                                                make_human_readable_str(dn->dstat.st_size, 1, 0));
                                } else {
-                                       column += printf("%9"OFF_FMT" ", (off_t) dn->dstat.st_size);
+                                       column += printf("%9"OFF_FMT"d ", (off_t) dn->dstat.st_size);
                                }
                        }
                        break;
@@ -648,10 +648,12 @@ static int list_single(struct dnode *dn)
 #endif
                case LIST_FILENAME:
                        errno = 0;
+#if ENABLE_FEATURE_LS_COLOR
                        if (show_color && !lstat(dn->fullname, &info)) {
                                printf("\033[%d;%dm", bgcolor(info.st_mode),
                                                fgcolor(info.st_mode));
                        }
+#endif
                        column += printf("%s", dn->name);
                        if (show_color) {
                                printf("\033[0m");
@@ -667,11 +669,13 @@ static int list_single(struct dnode *dn)
                                        append = append_char(info.st_mode);
                                }
 #endif
+#if ENABLE_FEATURE_LS_COLOR
                                if (show_color) {
                                        errno = 0;
                                        printf("\033[%d;%dm", bgcolor(info.st_mode),
                                                   fgcolor(info.st_mode));
                                }
+#endif
                                column += printf("%s", lpath) + 4;
                                if (show_color) {
                                        printf("\033[0m");