Module Name: src
Committed By: christos
Date: Sat Aug 21 12:38:56 UTC 2021
Modified Files:
src/lib/libedit: readline.c
Log Message:
PR/56370: mirabilos: libedit change from 2017 kills history in gdb
To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 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.163 src/lib/libedit/readline.c:1.164
--- src/lib/libedit/readline.c:1.163 Sat Aug 21 08:34:59 2021
+++ src/lib/libedit/readline.c Sat Aug 21 08:38:56 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.163 2021/08/21 12:34:59 christos Exp $ */
+/* $NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 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.163 2021/08/21 12:34:59 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -2078,6 +2078,7 @@ rl_callback_read_char(void)
const char *buf = el_gets(e, &count);
char *wbuf;
+ el_set(e, EL_UNBUFFERED, 1);
if (buf == NULL || count-- <= 0)
return;
if (count == 0 && buf[0] == e->el_tty.t_c[TS_IO][C_EOF])
@@ -2093,7 +2094,6 @@ rl_callback_read_char(void)
} else
wbuf = NULL;
(*(void (*)(const char *))rl_linefunc)(wbuf);
- el_set(e, EL_UNBUFFERED, 1);
}
}
@@ -2111,9 +2111,8 @@ rl_callback_handler_install(const char *
void
rl_callback_handler_remove(void)
{
+ el_set(e, EL_UNBUFFERED, 0);
rl_linefunc = NULL;
- el_end(e);
- e = NULL;
}
void