depoison the pure editline code from readline compatibility hacks.

This commit is contained in:
christos 2001-01-05 22:45:30 +00:00
parent 75ee9a37dd
commit 304ebe4875
2 changed files with 16 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: el.c,v 1.20 2000/11/11 22:18:57 christos Exp $ */
/* $NetBSD: el.c,v 1.21 2001/01/05 22:45:30 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
#else
__RCSID("$NetBSD: el.c,v 1.20 2000/11/11 22:18:57 christos Exp $");
__RCSID("$NetBSD: el.c,v 1.21 2001/01/05 22:45:30 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -63,7 +63,6 @@ __RCSID("$NetBSD: el.c,v 1.20 2000/11/11 22:18:57 christos Exp $");
public EditLine *
el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
{
extern char *rl_readline_name;
EditLine *el = (EditLine *) el_malloc(sizeof(EditLine));
#ifdef DEBUG
@ -85,15 +84,6 @@ el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
*/
el->el_flags = 0;
/* readline compat hack to make xxgdb work */
if (prog == rl_readline_name) {
struct termios t;
if (tcgetattr(el->el_infd, &t) == 0) {
if ((t.c_lflag & ECHO) == 0)
el->el_flags |= EDIT_DISABLED;
}
}
(void) term_init(el);
(void) key_init(el);
(void) map_init(el);

View File

@ -1,4 +1,4 @@
/* $NetBSD: readline.c,v 1.17 2001/01/05 21:15:49 jdolecek Exp $ */
/* $NetBSD: readline.c,v 1.18 2001/01/05 22:45:30 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if !defined(lint) && !defined(SCCSID)
__RCSID("$NetBSD: readline.c,v 1.17 2001/01/05 21:15:49 jdolecek Exp $");
__RCSID("$NetBSD: readline.c,v 1.18 2001/01/05 22:45:30 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@ -181,6 +181,8 @@ rl_initialize(void)
HistEvent ev;
const LineInfo *li;
int i;
int editmode = 1;
struct termios t;
if (e != NULL)
el_end(e);
@ -191,8 +193,18 @@ rl_initialize(void)
rl_instream = stdin;
if (!rl_outstream)
rl_outstream = stdout;
/*
* See if we don't really want to run the editor
*/
if (tcgetattr(fileno(rl_instream), &t) != -1 && (t.c_lflag & ECHO) == 0)
editmode = 0;
e = el_init(rl_readline_name, rl_instream, rl_outstream, stderr);
if (!editmode)
el_set(e, EL_EDITMODE, 0);
h = history_init();
if (!e || !h)
return (-1);