On 10/17/14, 1:54 PM, Jo Van Bulck wrote:
> Hi all,
>
> When trying to parse a string as if it has been read from the inputrc
> file, using the 'rl_parse_and_bind(char *line)' function, I get a
> segmentation fault when passing any non-empy string. I run Archlinux
> with readline version 'readline 6.3.006-1'.
It depends on the behavior of your compiler. rl_parse_and_bind wants to
modify the string it's passed by temporarily putting in NULs and later
restoring the original characters as part of tokenizing the line, similar
to strtok/strsep. If your compiler puts string constants into read-only
memory pages, you'll get a seg fault if you pass such a string constant to
rl_parse_and_bind.
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]
https://lists.gnu.org/mailman/listinfo/bug-readline