From: nicm Date: Sun, 28 Aug 2016 07:25:47 +0000 (+0000) Subject: Check the MORE (or LESS) environment variables after forcing the various X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b8270a5cba1945a1656188d390ff1e8817087af0;p=openbsd Check the MORE (or LESS) environment variables after forcing the various more(1) options, so it is possible to change them using MORE. From Ross L Richardson. ok deraadt millert --- diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c index 73e651b92d9..e0db6063baa 100644 --- a/usr.bin/less/main.c +++ b/usr.bin/less/main.c @@ -118,10 +118,6 @@ main(int argc, char *argv[]) init_prompt(); - s = lgetenv(less_is_more ? "MORE" : "LESS"); - if (s != NULL) - scan_option(estrdup(s)); - if (less_is_more) { /* this is specified by XPG */ quit_at_eof = OPT_ON; @@ -145,6 +141,10 @@ main(int argc, char *argv[]) top_scroll = OPT_OFF; } + s = lgetenv(less_is_more ? "MORE" : "LESS"); + if (s != NULL) + scan_option(estrdup(s)); + #define isoptstring(s) (((s)[0] == '-' || (s)[0] == '+') && (s)[1] != '\0') while (argc > 0 && (isoptstring(*argv) || isoptpending())) { s = *argv++;