bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] ^@ inserted when calling rl_delete_text


From: Chet Ramey
Subject: Re: [Bug-readline] ^@ inserted when calling rl_delete_text
Date: Wed, 16 Jul 2008 22:30:50 -0400
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Manuel Schölling wrote:
Hi guys,

I'm trying to build a completion function for gnuplot but when I call
rl_delete_text to delete the text to complete I always get the chars ^@
 as a prefix of my completions.

You don't adjust rl_point or rl_end after calling rl_delete_text.  It so
happens that rl_point is past the '\0' marking the end of rl_line_buffer.
When you insert the matches, you write past the end of the line buffer.
Readline happily extends it for you, but doesn't remove the NUL characters
you've left.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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