Package: less
Version: 406-0
Severity: normal
I have always had "/bin/more" symlinked to "/usr/bin/less" and I
typically invoke the program as "more". This has never caused
problems in the past.
In less-406, invoking the program as "more" automatically sets
the LESS_IS_MORE mode, and there is no way to turn it off.
The LESS_IS_MORE mode is very broken for me. With TERM=xterm,
files less than one page in length can not be seen at all, because
they flash up on the screen and disappear too quickly.
This can be demonstrated for example with
env -i TERM=xterm LESS_IS_MORE=1 less /etc/issue
env -i TERM=xterm LESS_IS_MORE=0 less /etc/issue
env -i TERM=xterm LESS_IS_xxxx=0 less /etc/issue
The first two fail, the third works fine. Previously this didn't
affect much, but now that LESS_IS_MORE is automatically set, there's
no way to work around it.
The attached patch fixes two problems:
- "LESS_IS_MORE" is now only automatically set if the variable was not
specified in the environment.
- "LESS_IS_MORE" mode is only enabled if the variable is set
explicitly to the value "1", as specified in the manpage.
This makes the second example above work as expected.
The default behavior is therefore unchanged, but at least I can
make things work by setting "LESS_IS_MORE=0" in my environment.
-jim
diff -urN less-406.orig/debian/changelog less-406/debian/changelog
--- less-406.orig/debian/changelog 2007-07-23 13:51:31.000000000 -0400
+++ less-406/debian/changelog 2007-07-23 14:11:58.000000000 -0400
@@ -1,3 +1,10 @@
+less (406-0jim) unstable; urgency=low
+
+ * Automatically set LESS_IS_MORE only if it's not already set in the
environment.
+ * Require the value of LESS_IS_MORE to be exactly 1, as specified in the
manpage.
+
+ -- Jim Paris <[EMAIL PROTECTED]> Mon, 23 Jul 2007 14:11:04 -0400
+
less (406-0) unstable; urgency=low
* New upstream release.
diff -urN less-406.orig/main.c less-406/main.c
--- less-406.orig/main.c 2007-06-17 12:56:04.000000000 -0400
+++ less-406/main.c 2007-07-23 14:11:03.000000000 -0400
@@ -128,7 +128,7 @@
if (s[-1] == PATHNAME_SEP[0])
break;
}
- if (strcmp(s, "more") == 0)
+ if (strcmp(s, "more") == 0 && lgetenv("LESS_IS_MORE") == NULL)
less_is_more = 1;
init_prompt();
diff -urN less-406.orig/opttbl.c less-406/opttbl.c
--- less-406.orig/opttbl.c 2007-06-17 12:56:04.000000000 -0400
+++ less-406/opttbl.c 2007-07-23 14:12:23.000000000 -0400
@@ -454,7 +454,7 @@
char *p;
p = lgetenv("LESS_IS_MORE");
- if (p != NULL && *p != '\0')
+ if (p != NULL && p[0] == '1' && p[1] == '\0')
less_is_more = 1;
for (o = option; o->oletter != '\0'; o++)
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.20.4 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages less depends on:
ii debianutils 2.22.1 Miscellaneous utilities specific t
ii libc6 2.6-2 GNU C Library: Shared libraries
ii libncurses5 5.6-3 Shared libraries for terminal hand
less recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]