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
This commit is contained in:
parent
13829828e7
commit
1d5cfebaca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149487
@ -1,3 +1,4 @@
|
|||||||
|
/* $FreeBSD$ */
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 1984-2002 Mark Nudelman
|
* 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.
|
* Shift the data to the end of the new linebuf.
|
||||||
*/
|
*/
|
||||||
for (fm = linebuf + old_size_linebuf,
|
for (fm = linebuf + old_size_linebuf - 1,
|
||||||
to = linebuf + size_linebuf;
|
to = linebuf + size_linebuf - 1;
|
||||||
fm >= linebuf; fm--, to--)
|
fm >= linebuf; fm--, to--)
|
||||||
*to = *fm;
|
*to = *fm;
|
||||||
n = size_linebuf - old_size_linebuf;
|
n = size_linebuf - old_size_linebuf;
|
||||||
|
Loading…
Reference in New Issue
Block a user