summaryrefslogtreecommitdiffstats
path: root/contrib/less
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2005-08-26 10:05:59 +0000
committertjr <tjr@FreeBSD.org>2005-08-26 10:05:59 +0000
commit7c5f6cabc9239f2525eb117021754427d7f1d202 (patch)
treeead8fc34e31a228e1ed222f670c940f3e86b2be0 /contrib/less
parenta234fe9966e361cc850871dc6ffa4d598817ebbe (diff)
downloadFreeBSD-src-7c5f6cabc9239f2525eb117021754427d7f1d202.zip
FreeBSD-src-7c5f6cabc9239f2525eb117021754427d7f1d202.tar.gz
Fix a one byte off error which causes "less" to crash if you view a
large file, jump to the end, scroll backwards with "b" and try to search backwards afterwards. Submitted by: Matthias Scheler
Diffstat (limited to 'contrib/less')
-rw-r--r--contrib/less/line.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/less/line.c b/contrib/less/line.c
index 14659f3..b537d35 100644
--- a/contrib/less/line.c
+++ b/contrib/less/line.c
@@ -1,3 +1,4 @@
+/* $FreeBSD$ */
/*
* Copyright (C) 1984-2002 Mark Nudelman
*
@@ -911,8 +912,8 @@ back_raw_line(curr_pos, linep)
/*
* Shift the data to the end of the new linebuf.
*/
- for (fm = linebuf + old_size_linebuf,
- to = linebuf + size_linebuf;
+ for (fm = linebuf + old_size_linebuf - 1,
+ to = linebuf + size_linebuf - 1;
fm >= linebuf; fm--, to--)
*to = *fm;
n = size_linebuf - old_size_linebuf;
OpenPOWER on IntegriCloud