summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-01-31 15:25:56 +0100
committerunknown <joerg@trift2.>2007-01-31 15:25:56 +0100
commitd28b5cec0db98ec2f6d5cd9bc9f9db27ba161275 (patch)
tree8ec4f89987c01b891b092b353d102bd8d56f8853 /client
parent06ea7ed510ab698f9786c64911fa6fc4792542e6 (diff)
downloadmariadb-git-d28b5cec0db98ec2f6d5cd9bc9f9db27ba161275.tar.gz
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".
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 4e479f3ff70..75dae284b61 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -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
}