From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Tue, 14 Apr 2026 11:44:43 +0800
Subject: set LESS_IS_MORE=0 to disable "more" compatibility mode

Origin: upstream, https://github.com/gwsw/less/commit/8990ba6b967243774a054b154b3619b08e166675
Bug-Debian: https://bugs.debian.org/434417
Applied-Upstream: v669

Setting LESS_IS_MORE=0 will disable "more" compatibility mode,
even if less is invoked via a file link named "more".
Applied-Upstream: v669
---
 main.c   | 3 ++-
 opttbl.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c
index aa3ef86..dbbf0e6 100644
--- a/main.c
+++ b/main.c
@@ -297,7 +297,8 @@ int main(int argc, constant char *argv[])
 	 * If the name of the executable program is "more",
 	 * act like LESS_IS_MORE is set.
 	 */
-	if (strcmp(last_component(progname), "more") == 0)
+	if (strcmp(last_component(progname), "more") == 0 &&
+			isnullenv(lgetenv("LESS_IS_MORE")))
 		less_is_more = 1;
 
 	init_prompt();
diff --git a/opttbl.c b/opttbl.c
index 2469285..23a3347 100644
--- a/opttbl.c
+++ b/opttbl.c
@@ -748,7 +748,7 @@ public void init_option(void)
 	constant char *p;
 
 	p = lgetenv("LESS_IS_MORE");
-	if (!isnullenv(p))
+	if (!isnullenv(p) && !(p[0] == '0' && p[1] == '\0'))
 		less_is_more = 1;
 
 	for (o = option;  o->oletter != '\0';  o++)
