[BusyBox-cvs] busybox/coreutils ls.c,1.102,1.103

Glenn McGrath bug1 at busybox.net
Sun Jan 18 05:41:32 UTC 2004


Update of /var/cvs/busybox/coreutils
In directory nail:/tmp/cvs-serv7752/coreutils

Modified Files:
	ls.c 
Log Message:
Fix a bug where `ls -le` would print the time twice.


Index: ls.c
===================================================================
RCS file: /var/cvs/busybox/coreutils/ls.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- ls.c	18 Jan 2004 05:15:16 -0000	1.102
+++ ls.c	18 Jan 2004 05:41:30 -0000	1.103
@@ -717,21 +717,21 @@
 			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




More information about the busybox-cvs mailing list