diff options
author | Cyril Zhang <cyril@freebsdfoundation.org> | 2021-05-13 12:52:51 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2021-05-13 13:33:19 +0000 |
commit | fa43162c63790806d0effba5ac98a1a3c6b835e1 (patch) | |
tree | a9a859daa395a650d9a6d657a8c39aaeb6cb0b8b | |
parent | 8b3c4231abf0ef6ac79655e463d0ef98ad84cd51 (diff) | |
download | src-fa43162c63790806d0effba5ac98a1a3c6b835e1.tar.gz src-fa43162c63790806d0effba5ac98a1a3c6b835e1.zip |
sort: Stop "fixing" obsolete key syntax after -- flag
PR: 255798
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30234
-rw-r--r-- | usr.bin/sort/sort.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index fee6f72449e2..d5c18552d914 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -858,6 +858,11 @@ fix_obsolete_keys(int *argc, char **argv) arg1 = argv[i]; + if (strcmp(arg1, "--") == 0) { + /* Following arguments are treated as filenames. */ + break; + } + if (strlen(arg1) > 1 && arg1[0] == '+') { int c1, f1; char sopts1[128]; |