From 3651faa511cb2ecd949d370a2bab4b02bf45f69b Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Thu, 3 Apr 2014 05:48:28 +0000 Subject: [PATCH] Make -f set -a, as required by the standard. From the original OpenBSD commit message: restore the traditional behavior of -f implying -a; apparently Keith Bostic forgot to restore it when the -f flag was put back on 2nd of September 1989, after being removed on 16th of August as a consequence of issues getting it working over NFS, so deviation from traditional UNIX behavior in all BSDs looks like an historical accident; as a side effect, this change accommodates behavior of this option to IEEE Std 1003.1-2008 (``POSIX.1''). joint work with jmc@ (who found the inaccuracy in our implementation), schwarze@ (who provided a detailed tracking of historical facts) and millert@ Submitted by: Igor Sobrado Discussed with: mckusick Obtained from: OpenBSD project MFC after: 2 weeks --- bin/ls/ls.1 | 2 ++ bin/ls/ls.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 8b7672b996c..d9e006bb84c 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -194,6 +194,8 @@ Use time when file status was last changed for sorting or printing. Directories are listed as plain files (not searched recursively). .It Fl f Output is not sorted. +This option turns on +.Fl a . .It Fl g This option is deprecated and is only available for compatibility with diff --git a/bin/ls/ls.c b/bin/ls/ls.c index be0903561f0..a46f358bd0c 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -226,6 +226,9 @@ main(int argc, char *argv[]) f_accesstime = 0; f_statustime = 0; break; + case 'f': + f_nosort = 1; + /* FALLTHROUGH */ case 'a': fts_options |= FTS_SEEDOT; /* FALLTHROUGH */ @@ -300,9 +303,6 @@ main(int argc, char *argv[]) f_listdir = 1; f_recursive = 0; break; - case 'f': - f_nosort = 1; - break; case 'g': /* Compatibility with 4.3BSD. */ break; case 'h':