summaryrefslogtreecommitdiff
path: root/usr.bin/less
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/less')
-rw-r--r--usr.bin/less/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c
index b247fe2e9cb..23bc1e6379c 100644
--- a/usr.bin/less/main.c
+++ b/usr.bin/less/main.c
@@ -121,8 +121,14 @@ main(argc, argv)
}
#endif
#define isoptstring(s) (((s)[0] == '-' || (s)[0] == '+') && (s)[1] != '\0')
- while (--argc > 0 && (isoptstring(argv[0]) || isoptpending()))
+ while (--argc > 0 && (isoptstring(argv[0]) || isoptpending())) {
+ if (strcmp(argv[0], "--") == 0) {
+ argv++;
+ argc--;
+ break;
+ }
scan_option(*argv++);
+ }
#undef isoptstring
if (isoptpending())