git: ff86c97bfa54 - stable/14 - ls: versort incompatible w/ timesort and sizesort

From: Gordon Bergling <gbe_at_FreeBSD.org>
Date: Wed, 28 Feb 2024 12:49:05 UTC
The branch stable/14 has been updated by gbe:

URL: https://cgit.FreeBSD.org/src/commit/?id=ff86c97bfa54f1e305f4ce07e560a4b3780a6477

commit ff86c97bfa54f1e305f4ce07e560a4b3780a6477
Author:     Alexander Ziaee <concussious@runbox.com>
AuthorDate: 2024-02-02 20:19:07 +0000
Commit:     Gordon Bergling <gbe@FreeBSD.org>
CommitDate: 2024-02-28 12:47:08 +0000

    ls: versort incompatible w/ timesort and sizesort
    
    ls.1: versort incompatible w/ timesort and sizesort
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/825
    
    (cherry picked from commit d854370fa86b74527e57145955b1fa3ca75643a2)
---
 bin/ls/ls.1 |  6 +++---
 bin/ls/ls.c | 12 ++++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/bin/ls/ls.1 b/bin/ls/ls.1
index 528ff1594876..0d03fce804f2 100644
--- a/bin/ls/ls.1
+++ b/bin/ls/ls.1
@@ -31,7 +31,7 @@
 .\"
 .\"     @(#)ls.1	8.7 (Berkeley) 7/29/94
 .\"
-.Dd July 18, 2023
+.Dd January 12, 2024
 .Dt LS 1
 .Os
 .Sh NAME
@@ -459,9 +459,9 @@ options all override each other; the last one specified determines
 the file time used.
 .Pp
 The
-.Fl S
+.Fl S , t
 and
-.Fl t
+.Fl v
 options override each other; the last one specified determines
 the sort order used.
 .Pp
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 842364b67f1f..d358ece2d89e 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -325,14 +325,21 @@ main(int argc, char *argv[])
 		case 'A':
 			f_listdot = 1;
 			break;
-		/* The -t and -S options override each other. */
+		/* The -S, -t and -v options override each other. */
 		case 'S':
 			f_sizesort = 1;
 			f_timesort = 0;
+			f_verssort = 0;
 			break;
 		case 't':
 			f_timesort = 1;
 			f_sizesort = 0;
+			f_verssort = 0;
+			break;
+		case 'v':
+			f_verssort = 1;
+			f_sizesort = 0;
+			f_verssort = 0;
 			break;
 		/* Other flags.  Please keep alphabetic. */
 		case ',':
@@ -446,9 +453,6 @@ main(int argc, char *argv[])
 		case 's':
 			f_size = 1;
 			break;
-		case 'v':
-			f_verssort = 1;
-			break;
 		case 'w':
 			f_nonprint = 0;
 			f_octal = 0;