summaryrefslogtreecommitdiffstats
path: root/contrib/less/line.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-07-29 09:20:32 +0000
committerdelphij <delphij@FreeBSD.org>2009-07-29 09:20:32 +0000
commita1420f2d09d95e286325db1a123862cb8a6fb33d (patch)
tree4fdfa6d784030f8906ba6b58fa39cec909b27661 /contrib/less/line.c
parent7b17971146d9d04f6fdfc56456eda87bddfb201f (diff)
parenta169eab989211273bac7f266a725febc6d6767ef (diff)
downloadFreeBSD-src-a1420f2d09d95e286325db1a123862cb8a6fb33d.zip
FreeBSD-src-a1420f2d09d95e286325db1a123862cb8a6fb33d.tar.gz
Update less to v436. This is considered as a bugfix release from vendor.
Major changes from v429: * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". * Allow a fraction as the argument to the -# (--shift) option. * Fix highlight bug when underlined/overstruck text matches at end of line. * Fix non-regex searches with ctrl-R. Approved by: re (kensmith, kib)
Diffstat (limited to 'contrib/less/line.c')
-rw-r--r--contrib/less/line.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/less/line.c b/contrib/less/line.c
index b3d9c2f..5a35084 100644
--- a/contrib/less/line.c
+++ b/contrib/less/line.c
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2008 Mark Nudelman
+ * Copyright (C) 1984-2009 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -990,12 +990,10 @@ pflushmbc()
* Terminate the line in the line buffer.
*/
public void
-pdone(endline, nextc)
+pdone(endline, forw)
int endline;
- int nextc;
+ int forw;
{
- int nl;
-
(void) pflushmbc();
if (pendc && (pendc != '\r' || !endline))
@@ -1042,7 +1040,7 @@ pdone(endline, nextc)
attr[curr] = AT_NORMAL;
curr++;
}
- else if (ignaw && column >= sc_width)
+ else if (ignaw && column >= sc_width && forw)
{
/*
* Terminals with "ignaw" don't wrap until they *really* need
@@ -1051,12 +1049,14 @@ pdone(endline, nextc)
* get in the state where a full screen width of characters
* have been output but the cursor is sitting on the right edge
* instead of at the start of the next line.
- * So we nudge them into wrapping by outputting the next
- * character plus a backspace. (This wouldn't be right for
- * "!auto_wrap" terminals, but they always end up in the
- * branch above.)
+ * So we nudge them into wrapping by outputting a space
+ * character plus a backspace. But do this only if moving
+ * forward; if we're moving backward and drawing this line at
+ * the top of the screen, the space would overwrite the first
+ * char on the next line. We don't need to do this "nudge"
+ * at the top of the screen anyway.
*/
- linebuf[curr] = nextc;
+ linebuf[curr] = ' ';
attr[curr++] = AT_NORMAL;
linebuf[curr] = '\b';
attr[curr++] = AT_NORMAL;
OpenPOWER on IntegriCloud