Module Name: src
Committed By: christos
Date: Wed Aug 21 11:11:48 UTC 2019
Modified Files:
src/lib/libedit: readline.c
Log Message:
Increment offset when adding an element to history to keep it aligned with
the last element entered (Sandy Li Changqing)
To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/lib/libedit/readline.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.156 src/lib/libedit/readline.c:1.157
--- src/lib/libedit/readline.c:1.156 Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/readline.c Wed Aug 21 07:11:48 2019
@@ -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 @@ add_history(const char *line)
(void)history(h, &ev, H_GETSIZE);
if (ev.num == history_length)
history_base++;
- else
+ else {
+ history_offset++;
history_length = ev.num;
+ }
return 0;
}