From 9c0bd42e1e1976aa2b56165c1e4e3c5d629e26d2 Mon Sep 17 00:00:00 2001 From: grog Date: Thu, 8 Nov 2012 00:24:26 +0000 Subject: Add y flag and environment variable LS_SAMESORT to specify the same sorting order for time and name with the -t option. IEEE Std 1003.2 (POSIX.2) mandates that the -t option sort in descending order, and that if two files have the same timestamp, they should be sorted in ascending order of their names. The -r flag reverses both of these sort orders, so they're never the same. This creates significant problems for sequentially named files stored on FAT file systems, where it can be impossible to list them in the order in which they were created. Add , (comma) option to print file sizes grouped and separated by thousands using the non-monetary separator returned by localeconv(3), typically a comma or period. MFC after: 14 days --- bin/ls/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/ls/util.c') diff --git a/bin/ls/util.c b/bin/ls/util.c index ecb1732..7fa6606 100644 --- a/bin/ls/util.c +++ b/bin/ls/util.c @@ -175,7 +175,7 @@ prn_octal(const char *s) size_t clen; unsigned char ch; int goodchar, i, len, prtlen; - + memset(&mbs, 0, sizeof(mbs)); len = 0; while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) { @@ -222,9 +222,9 @@ usage(void) { (void)fprintf(stderr, #ifdef COLORLS - "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #else - "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #endif " [file ...]\n"); exit(1); -- cgit v1.1