Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit Increment offset when adding an element to histo...



details:   https://anonhg.NetBSD.org/src/rev/0ddac64b42db
branches:  trunk
changeset: 453652:0ddac64b42db
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Aug 21 11:11:48 2019 +0000

description:
Increment offset when adding an element to history to keep it aligned with
the last element entered (Sandy Li Changqing)

diffstat:

 lib/libedit/readline.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 62f4b4be17a8 -r 0ddac64b42db lib/libedit/readline.c
--- a/lib/libedit/readline.c    Wed Aug 21 10:48:37 2019 +0000
+++ b/lib/libedit/readline.c    Wed Aug 21 11:11:48 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.c,v 1.156 2019/07/23 10:18:52 christos Exp $  */
+/*     $NetBSD: readline.c,v 1.157 2019/08/21 11:11:48 christos Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.156 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.157 2019/08/21 11:11:48 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -1477,8 +1477,10 @@
        (void)history(h, &ev, H_GETSIZE);
        if (ev.num == history_length)
                history_base++;
-       else
+       else {
+               history_offset++;
                history_length = ev.num;
+       }
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index