bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] rl_prep_terminal segfault


From: Chet Ramey
Subject: Re: [Bug-readline] rl_prep_terminal segfault
Date: Mon, 02 Aug 2010 15:24:51 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1

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    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]