summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath2004-01-18 05:41:30 +0000
committerGlenn L McGrath2004-01-18 05:41:30 +0000
commit65b6d8bdb6375c010d70f7aad399dae7c3ec15f6 (patch)
treeed64fecaace11212bd4f2ee36df77f34a04f5449
parent792cae5f2a234c00c8c79783e2474135e0a78554 (diff)
downloadbusybox-65b6d8bdb6375c010d70f7aad399dae7c3ec15f6.zip
busybox-65b6d8bdb6375c010d70f7aad399dae7c3ec15f6.tar.gz
Fix a bug where `ls -le` would print the time twice.
-rw-r--r--coreutils/ls.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 18cffb1..2f81ee0 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -717,21 +717,21 @@ static int list_single(struct dnode *dn)
break;
#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
case LIST_FULLTIME:
+ printf("%24.24s ", filetime);
+ column += 25;
+ break;
case LIST_DATE_TIME:
- if (all_fmt & LIST_FULLTIME) {
- printf("%24.24s ", filetime);
- column += 25;
- break;
- }
- age = time(NULL) - ttime;
- printf("%6.6s ", filetime + 4);
- if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
- /* hh:mm if less than 6 months old */
- printf("%5.5s ", filetime + 11);
- } else {
- printf(" %4.4s ", filetime + 20);
+ if ((all_fmt & LIST_FULLTIME) == 0) {
+ age = time(NULL) - ttime;
+ printf("%6.6s ", filetime + 4);
+ if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
+ /* hh:mm if less than 6 months old */
+ printf("%5.5s ", filetime + 11);
+ } else {
+ printf(" %4.4s ", filetime + 20);
+ }
+ column += 13;
}
- column += 13;
break;
#endif
#ifdef CONFIG_SELINUX