From fa43162c63790806d0effba5ac98a1a3c6b835e1 Mon Sep 17 00:00:00 2001 From: Cyril Zhang Date: Thu, 13 May 2021 08:52:51 -0400 Subject: [PATCH] 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 --- usr.bin/sort/sort.c | 5 +++++ 1 file changed, 5 insertions(+) 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];