Subject: lib/31012: libedit el_get with EL_EDITOR op does not work
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <bnaujok@sgi.com>
List: netbsd-bugs
Date: 08/19/2005 03:59:00
>Number:         31012
>Category:       lib
>Synopsis:       libedit el_get with EL_EDITOR op does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 19 03:59:00 +0000 2005
>Originator:     Barry Naujok
>Release:        
>Organization:
SGI
>Environment:
>Description:
When trying to get the current editing mode from the editline
using the following code, it does not work:

const char *mode;
el_get(el, EL_EDITOR, &mode);
printf("mode = %s\n", mode);

mode is never modified.


>How-To-Repeat:

>Fix:
Looking is el.c in the el_get function, EL_EDITOR has the following 
code:

case EL_EDITOR:
        rv = map_get_editor(el, (void *) &ret);
        break;

To fix the problem, I changed the above to (like the EL_TERMINAL case):

case EL_EDITOR:
        rv = map_get_editor(el, (const char **)ret);
        break;

I suspect the EL_PROMPT and EL_RPROMPT cases are broken too with the
(void *)&ret method.