On 7/29/10 3:09 AM, Otto Allmendinger wrote:
> This produces a segfault on my system (Arch Linux)
> 
> 
> #include <stdio.h>
> #include <readline/readline.h>
> 
> int main(int argc, char** argv) {
>     rl_prep_terminal(0);
>     return 0;
> }
> 

Readline really wants you to set up rl_instream and rl_outstream before
it tries to use those file descriptors as handles to the terminal.  Adding

rl_instream = stdin;
rl_instream = stdout;

makes your example work.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/

_______________________________________________
Bug-readline mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to