Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit off by one in fetching history data. From: Gerry...



details:   https://anonhg.NetBSD.org/src/rev/38997befe854
branches:  trunk
changeset: 760895:38997befe854
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 16 03:05:51 2011 +0000

description:
off by one in fetching history data. From: Gerry Swislow

diffstat:

 lib/libedit/history.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5dfdaaab1961 -r 38997befe854 lib/libedit/history.c
--- a/lib/libedit/history.c     Sun Jan 16 02:45:48 2011 +0000
+++ b/lib/libedit/history.c     Sun Jan 16 03:05:51 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: history.c,v 1.37 2010/01/03 18:27:10 christos Exp $    */
+/*     $NetBSD: history.c,v 1.38 2011/01/16 03:05:51 christos Exp $    */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)history.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: history.c,v 1.37 2010/01/03 18:27:10 christos Exp $");
+__RCSID("$NetBSD: history.c,v 1.38 2011/01/16 03:05:51 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -857,7 +857,7 @@
        int retval;
 
        for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
-               if (num-- <= 0) {
+               if (ev->num == num) {
                        if (d)
                                *d = ((history_t *)h->h_ref)->cursor->data;
                        return (0);



Home | Main Index | Thread Index | Old Index