Fix for NetBSD 1.3 changes.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3881 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1997-11-09 12:47:04 +00:00
parent a68d3511bb
commit da806af9ce

View File

@@ -38,6 +38,7 @@
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <histedit.h>
RCSID("$Id$");
@@ -64,13 +65,20 @@ char *
readline(const char* prompt)
{
static EditLine *e;
#ifdef H_SETMAXSIZE
HistEvent ev;
#endif
int count;
char *ret;
if(e == NULL){
e = el_init("", stdin, stdout);
el_set(e, EL_PROMPT, ret_prompt);
h = history_init();
#ifdef H_SETMAXSIZE
history(h, &ev, H_SETMAXSIZE, 25);
#else
history(h, H_EVENT, 25);
#endif
el_set(e, EL_HIST, history, h);
el_set(e, EL_EDITOR, "emacs"); /* XXX? */
}
@@ -87,5 +95,10 @@ readline(const char* prompt)
void
add_history(char *p)
{
#ifdef H_SETMAXSIZE
HistEvent ev;
history(h, &ev, H_ENTER, p);
#else
history(h, H_ENTER, p);
#endif
}