summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-03-05 18:44:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-03-05 18:44:03 +0000
commitf416d1679d76012f25d60123409c5a036f5ff1b4 (patch)
tree81b664ffde219cfdaa055c71f99469737445d039
parent12e940e3c0ecd3bfd23e2668caa47b856a76a155 (diff)
provide support for -- argument seperator
-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())