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
NetBSD 6.99.1 NetBSD 6.99.1 (GENERIC) #0: Fri Feb 17 13:43:00 
JST 2012 i386
The user program can set input/output stream of readline by 
But libedit readline wrapper doesn't reset its internal el_infile/el_outfile
even if the user program change the value after initialization.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <readline/readline.h>
int main(void)
    int pipes[2];
    printf("r:%s\n", readline("> "));
    rl_instream = fdopen(pipes[0], "rb");
    write(pipes[1], "foo\n", 4);
    printf("r:%s\n", readline("> "));
    return 0;

Home | Main Index | Thread Index | Old Index