[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address XXX comment at lines 987-990 in bashfile.c
From: |
Chet Ramey |
Subject: |
Re: address XXX comment at lines 987-990 in bashfile.c |
Date: |
Sat, 11 Jul 2015 18:32:40 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 7/11/15 4:15 PM, Bill Parker wrote:
> The comment above the line would seem to indicate otherwise:
>
> Here is the comment:
>
> /* Now erase the contents of the current line and undo the effects of the
> rl_accept_line() above. We don't even want to make the text we just
> executed available for undoing. */
Eduardo is correct. The valid portion of the readline line buffer is the
string bounded by 0 and rl_end. rl_line_buffer[rl_end] == 0, and setting
rl_line_buffer[rl_point = rl_end = 0] is sufficient to erase the contents
of the line buffer.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/