bug-readline
[Top][All Lists]
Advanced

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

[Bug-readline] readline and history: order of libraries


From: lusth
Subject: [Bug-readline] readline and history: order of libraries
Date: Wed, 17 Jun 2009 10:10:35 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

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
address@hidden




reply via email to

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