summaryrefslogtreecommitdiffstats
path: root/contrib/less
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2007-06-23 15:28:00 +0000
committerdelphij <delphij@FreeBSD.org>2007-06-23 15:28:00 +0000
commit18998e91970d774f7941d06eecac8f26172e0051 (patch)
treed14950a7f2aba40717a134231142e45ec36e4a15 /contrib/less
parent2ee5e24fd124a16c12d49ef8363a6050d276783f (diff)
downloadFreeBSD-src-18998e91970d774f7941d06eecac8f26172e0051.zip
FreeBSD-src-18998e91970d774f7941d06eecac8f26172e0051.tar.gz
In more(1) mode, restore the historical behavior where curses init
and deinit characters are not delivered. Instead of hacking screen.c, we set no_init to implement the behavior. Reported by: mnag Approved by: re (hrs)
Diffstat (limited to 'contrib/less')
-rw-r--r--contrib/less/main.c3
-rw-r--r--contrib/less/screen.c14
2 files changed, 4 insertions, 13 deletions
diff --git a/contrib/less/main.c b/contrib/less/main.c
index 84b58b9..5edcfd8 100644
--- a/contrib/less/main.c
+++ b/contrib/less/main.c
@@ -59,6 +59,7 @@ static char consoleTitle[256];
extern int missing_cap;
extern int know_dumb;
extern int quit_if_one_screen;
+extern int no_init;
extern int pr_type;
@@ -165,7 +166,7 @@ main(argc, argv)
}
if (less_is_more && get_quit_at_eof())
- quit_if_one_screen = TRUE;
+ no_init = quit_if_one_screen = TRUE;
#if EDITOR
editor = lgetenv("VISUAL");
diff --git a/contrib/less/screen.c b/contrib/less/screen.c
index e217b86..a081918 100644
--- a/contrib/less/screen.c
+++ b/contrib/less/screen.c
@@ -228,8 +228,6 @@ extern int quiet; /* If VERY_QUIET, use visual bell for bell */
extern int no_back_scroll;
extern int swindow;
extern int no_init;
-extern int quit_at_eof;
-extern int less_is_more;
extern int no_keypad;
extern int sigs;
extern int wscroll;
@@ -1211,19 +1209,11 @@ get_term()
if (sc_e_keypad == NULL)
sc_e_keypad = "";
- /*
- * This loses for terminals with termcap entries with ti/te strings
- * that switch to/from an alternate screen, and we're in quit_at_eof
- * (eg, more(1)).
- */
- if (!quit_at_eof && !less_is_more) {
- sc_init = ltgetstr("ti", &sp);
- sc_deinit = ltgetstr("te", &sp);
- }
-
+ sc_init = ltgetstr("ti", &sp);
if (sc_init == NULL)
sc_init = "";
+ sc_deinit= ltgetstr("te", &sp);
if (sc_deinit == NULL)
sc_deinit = "";
OpenPOWER on IntegriCloud