On Thu, 1 Nov 2001, Joerg Wunsch wrote:

> Luigi Rizzo <[EMAIL PROTECTED]> wrote:
> > I have been experiencing this problem for sometimes on CURRENT-based
> > picobsd images: the shell coredumps if it does not find an
> > entry for its terminal type in /etc/termcap.
> Seems to be a »feature« of the new libedit.

Try this fix.  libedit now does more error checking, but doesn't check
the error codes properly.  It checks too much in term_init() so it
doesn't initialize the arrow keys.  Then it doesn't check enough in
term_init()'s caller[s], so it continues when there is no terminal and
soon uses the uninitialized arrow keys.  Continuing when there is no
terminal is correct and should give builtin defaults for a dumb terminal
like it used to.

Symptoms of the bug, at least on i386's: if malloc() returns zeroed
storage, then the uninitialized arrow keys are sort of initialized (to
0), and the arrow keys just don't work.  If malloc() returns the garbage
given by the default malloc options, then the uninitialized arrow keys
cause a core dump.

I still think the correct fix is to back out the libedit changes and
start over.

Index: term.c
RCS file: /home/ncvs/src/lib/libedit/term.c,v
retrieving revision 1.15
diff -u -2 -r1.15 term.c
--- term.c      1 Oct 2001 08:41:25 -0000       1.15
+++ term.c      9 Nov 2001 07:30:51 -0000
@@ -339,7 +339,7 @@
        (void) memset(el->el_term.t_val, 0, T_val * sizeof(int));
        term_outfile = el->el_outfile;
+       term_init_arrow(el);
        if (term_set(el, NULL) == -1)
                return (-1);
-       term_init_arrow(el);
        return (0);


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to