1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fix bug#23293 "readline detection broken on NetBSD":

Its root cause is a difference between the "readline" and "libedit" (header files)
definitions of "rl_completion_entry_function", where the "libedit" one is wrong anyway:
This variable is used as a pointer to a function returning "char *",
but "libedit" declares it as returning "int" and then adds casts on usage.

Change it to "CPFunction *" and get rid of the casts.


client/mysql.cc:
  Fix bug#23293 "readline detection broken on NetBSD":
  
  Now that the "libedit" header files declares "rl_completion_entry_function" correctly,
  it need not be cast on usage, and "no_completion()" can be declared to return "char *".
cmd-line-utils/libedit/readline.c:
  Fix bug#23293 "readline detection broken on NetBSD":
  
  Now that the "libedit" header files declares "rl_completion_entry_function" correctly,
  it need not be cast on usage, and "complet_func()" is a "CPFunction *" as well.
cmd-line-utils/libedit/readline/readline.h:
  Fix bug#23293 "readline detection broken on NetBSD":
  
  Declare "rl_completion_entry_function()" to be a "CPFunction *", this avoids casts
  and brings "libedit" in sync with "readline".
This commit is contained in:
unknown
2007-01-31 15:25:56 +01:00
parent 0142be558f
commit 7a71303c90
3 changed files with 9 additions and 10 deletions

View File

@@ -1420,7 +1420,7 @@ static char **new_mysql_completion (const char *text, int start, int end);
#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
char *no_completion(const char*,int)
#else
int no_completion()
char *no_completion()
#endif
{
return 0; /* No filename completion */
@@ -1508,10 +1508,10 @@ static void initialize_readline (char *name)
setlocale(LC_ALL,""); /* so as libedit use isprint */
#endif
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
rl_completion_entry_function= (Function*)&no_completion;
rl_completion_entry_function= &no_completion;
#else
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
rl_completion_entry_function= (Function*)&no_completion;
rl_completion_entry_function= &no_completion;
#endif
}