Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/less/less Fix a one byte off error which causes "les...



details:   https://anonhg.NetBSD.org/src/rev/7821c30100e7
branches:  trunk
changeset: 583816:7821c30100e7
user:      tron <tron%NetBSD.org@localhost>
date:      Wed Aug 24 11:33:09 2005 +0000

description:
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.

diffstat:

 usr.bin/less/less/line.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r b52f32d720ee -r 7821c30100e7 usr.bin/less/less/line.c
--- a/usr.bin/less/less/line.c  Wed Aug 24 10:19:43 2005 +0000
+++ b/usr.bin/less/less/line.c  Wed Aug 24 11:33:09 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: line.c,v 1.9 2004/08/26 01:29:20 wiz Exp $     */
+/*     $NetBSD: line.c,v 1.10 2005/08/24 11:33:09 tron Exp $   */
 
 /*
  * Copyright (C) 1984-2002  Mark Nudelman
@@ -916,8 +916,8 @@
                        /*
                         * 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;



Home | Main Index | Thread Index | Old Index