Finish initializing all the term data structures even if the terminal init

fails. This makes editline work on dumb terminals again. Noted by mycroft.
Oops, too agressive error checking.
This commit is contained in:
christos 2001-11-02 04:42:09 +00:00
parent 895db4cb83
commit 41df15832a
1 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: term.c,v 1.32 2001/01/23 15:55:31 jdolecek Exp $ */
/* $NetBSD: term.c,v 1.33 2001/11/02 04:42:09 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
#else
__RCSID("$NetBSD: term.c,v 1.32 2001/01/23 15:55:31 jdolecek Exp $");
__RCSID("$NetBSD: term.c,v 1.33 2001/11/02 04:42:09 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -321,6 +321,7 @@ term_setflags(EditLine *el)
protected int
term_init(EditLine *el)
{
int error;
el->el_term.t_buf = (char *) el_malloc(TC_BUFSIZE);
if (el->el_term.t_buf == NULL)
@ -341,10 +342,9 @@ term_init(EditLine *el)
return (-1);
(void) memset(el->el_term.t_val, 0, T_val * sizeof(int));
term_outfile = el->el_outfile;
if (term_set(el, NULL) == -1)
return (-1);
error = term_set(el, NULL);
term_init_arrow(el);
return (0);
return (error);
}
/* term_end():
* Clean up the terminal stuff