NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/46059: libedit readline doesn't reset el_infile/el_outfile



>Number:         46059
>Category:       lib
>Synopsis:       libedit readline doesn't reset el_infile/el_outfile
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 20 09:00:01 +0000 2012
>Originator:     Yui NARUSE
>Release:        NetBSD 6.99.1 i386
>Organization:
>Environment:
NetBSD nbsd.rubyci.org 6.99.1 NetBSD 6.99.1 (GENERIC) #0: Fri Feb 17 13:43:00 
JST 2012  
naruse%nbsd.rubyci.org@localhost:/usr/obj/sys/arch/i386/compile/GENERIC i386
>Description:
The user program can set input/output stream of readline by 
rl_instream/rl_outstream.
But libedit readline wrapper doesn't reset its internal el_infile/el_outfile
even if the user program change the value after initialization.
>How-To-Repeat:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <readline/readline.h>
int main(void)
{
    int pipes[2];
    pipe(pipes);
    printf("r:%s\n", readline("> "));
    rl_instream = fdopen(pipes[0], "rb");
    write(pipes[1], "foo\n", 4);
    printf("r:%s\n", readline("> "));
    return 0;
}
>Fix:



Home | Main Index | Thread Index | Old Index