summaryrefslogtreecommitdiffstats
path: root/usr.bin/more
diff options
context:
space:
mode:
authorhoek <hoek@FreeBSD.org>1999-06-02 03:42:39 +0000
committerhoek <hoek@FreeBSD.org>1999-06-02 03:42:39 +0000
commit32b616a48e67944eea9704d712d8cc7adc80bfb3 (patch)
treecae4bf3b1aea4961faddad2c13a49487d92d3b2e /usr.bin/more
parent3b531265df52d6694a750e5ccc98f84ec147c98f (diff)
downloadFreeBSD-src-32b616a48e67944eea9704d712d8cc7adc80bfb3.zip
FreeBSD-src-32b616a48e67944eea9704d712d8cc7adc80bfb3.tar.gz
Don't print backspaces in first column since they backup to the prev line.
Diffstat (limited to 'usr.bin/more')
-rw-r--r--usr.bin/more/output.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/more/output.c b/usr.bin/more/output.c
index ab8367d..862dbc2 100644
--- a/usr.bin/more/output.c
+++ b/usr.bin/more/output.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)output.c 8.1 (Berkeley) 6/6/93";
#ifndef lint
static const char rcsid[] =
- "$Id$";
+ "$Id: output.c,v 1.9 1999/05/30 18:06:56 hoek Exp $";
#endif /* not lint */
/*
@@ -196,10 +196,17 @@ put_line()
} while ((column % tabstop) != 0);
break;
case '\b':
- /* markup() before putbs() ? */
- column += markup(&ent_ul, &ent_bo);
- putbs();
- column--;
+ /*
+ * column must be at least one greater than
+ * eff_horiz_off (ie. we must be in the second or
+ * beyond screen column) or we'll just end-up
+ * backspacing up to the previous line.
+ */
+ if (column > eff_horiz_off) {
+ column += markup(&ent_ul, &ent_bo);
+ putbs();
+ column--;
+ }
break;
case '\r':
/* treat \r\n sequences like \n if -u flag not set. */
OpenPOWER on IntegriCloud