Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit Fix previous to better match readline behavior (...



details:   https://anonhg.NetBSD.org/src/rev/f4950abb6aae
branches:  trunk
changeset: 815773:f4950abb6aae
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 02 21:40:51 2016 +0000

description:
Fix previous to better match readline behavior (Ingo Schwarze)

diffstat:

 lib/libedit/readline.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r bc7636062895 -r f4950abb6aae lib/libedit/readline.c
--- a/lib/libedit/readline.c    Thu Jun 02 21:19:24 2016 +0000
+++ b/lib/libedit/readline.c    Thu Jun 02 21:40:51 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.c,v 1.135 2016/06/02 15:11:18 christos Exp $  */
+/*     $NetBSD: readline.c,v 1.136 2016/06/02 21:40:51 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.135 2016/06/02 15:11:18 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.136 2016/06/02 21:40:51 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -1185,6 +1185,8 @@
 
        if (history(h, &ev, H_SETSIZE, max) == 0) {
                max_input_history = max;
+               if (history_length > max)
+                       history_base = history_length - max;
                while (history_length > max) {
                        he = remove_history(0);
                        el_free(he->data);



Home | Main Index | Thread Index | Old Index