From eb49d011e693893bb140d88ea31fd073df22ea8c Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Tue, 26 Nov 2002 14:03:25 +0100 Subject: [PATCH] mysql.cc has to support older readline to compile on FreeBSD :(( --- client/mysql.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 391779ef801..13943691fb4 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1070,9 +1070,13 @@ static void initialize_readline (char *name) rl_readline_name = name; /* Tell the completer that we want a crack first. */ - /* rl_attempted_completion_function = (CPPFunction *)mysql_completion;*/ +#if RL_READLINE_VERSION > 0x0400 rl_attempted_completion_function = &new_mysql_completion; rl_completion_entry_function= &no_completion; +#else + rl_attempted_completion_function =(CPPFunction *)new_mysql_completion; + rl_completion_entry_function= (Function *)no_completion; +#endif } /* @@ -1087,7 +1091,11 @@ static char **new_mysql_completion (const char *text, int end __attribute__((unused))) { if (!status.batch && !quick) +#if RL_READLINE_VERSION > 0x0400 return rl_completion_matches(text, new_command_generator); +#else + return completion_matches((char *)text, (CPFunction *)new_command_generator); +#endif else return (char**) 0; }