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

Re: signals, handeling the Control-D signal



OK, this is not a C language help list, nor a libreadline man^winfo page.
However..:

Barry Pollock wrote:

>   line_read = readline ("");
>   /* If the line has any text in it, save it on the history.
> The control -D must be intercepted here */

So what is your problem?

>   if (line_read && *line_read)
>     add_history (line_read);
else if (line_read) { /* process empty line */ }
else { /* process ^D, i.e. end-of-input */ }

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
-- 
"I'd love to go out with you, but I did my own thing and now I've got
to undo it."



Reply to: