version: libreadline.so.5, libhistory.so.5
machines: intel i386, AMD 64
OS: ubuntu 9.04
compilation flags: none
description:
   if readline/history program is compiled like so:

       gcc prog.c -lhistory -lreadline

   the program seg faults when attempting to recover
   a string stored in the history. Program:
#include <readline/readline.h>
   #include <readline/history.h>
   int main()
       {
        add_history("whoa");
        (void) readline("enter: "); #user enters up-arrow here
        return 0;
        }

fix: reverse order of libraries:

       gcc prog.c -lreadline -lhistory

comment: order of libraries should not matter since readline and
history are closely coupled.

john
[email protected]


_______________________________________________
Bug-readline mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to