1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-10 12:58:35 +03:00

r19246: merge from samba4 rev 18207 and 18208:

readline fixes for mac os 10

metze
This commit is contained in:
Stefan Metzmacher 2006-10-11 13:59:03 +00:00 committed by Gerald (Jerry) Carter
parent eb1f0b49cf
commit 976b97ecbf
2 changed files with 10 additions and 1 deletions

View File

@ -1183,6 +1183,13 @@ AC_CHECK_LIB(readline, rl_completion_matches,
[],
[$TERMLIBS])
# not all readline libs have rl_event_hook or history_list
AC_CHECK_DECLS(rl_event_hook, [], [], [#include <readline/readline.h>])
AC_CHECK_LIB(readline, history_list,
[AC_DEFINE(HAVE_HISTORY_LIST, 1, [Do we have history_list?])],
[],
[$TERMLIBS])
# The following test taken from the cvs sources
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has

View File

@ -113,8 +113,10 @@ char *smb_readline(const char *prompt, void (*callback)(void),
rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn;
}
#if HAVE_DECL_RL_EVENT_HOOK
if (callback)
rl_event_hook = (Function *)callback;
#endif
ret = readline(prompt);
if (ret && *ret)
add_history(ret);
@ -154,7 +156,7 @@ history
****************************************************************************/
int cmd_history(void)
{
#if defined(HAVE_LIBREADLINE)
#if defined(HAVE_LIBREADLINE) && defined(HAVE_HISTORY_LIST)
HIST_ENTRY **hlist;
int i;