summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2018-11-03 18:00:22 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-08-11 12:32:08 +0300
commit98b24da03808d562bf37e0ae00ba2c6e0c5cc5c3 (patch)
tree5083dce21d0097cb93d50b99eb11589fce182bcb /client
parent22914ec793b850438c77acf070f8441cf307ebf6 (diff)
downloadmariadb-git-98b24da03808d562bf37e0ae00ba2c6e0c5cc5c3.tar.gz
MDEV-17609 mysql client sets wrong application name for Readline library
initialize_readline() is called with full pathname of executable which sets rl_readline_name to that value. It is expected that rl_readline_name is initialized with static name not depending on the file name at all. Needed for setting custom hotkeys in .inputrc
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 0fba75cfa32..6c8485a5143 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1060,7 +1060,7 @@ extern "C" int write_history(const char *command);
extern "C" HIST_ENTRY *history_get(int num);
extern "C" int history_length;
static int not_in_history(const char *line);
-static void initialize_readline (char *name);
+static void initialize_readline ();
static void fix_history(String *final_command);
#endif
@@ -1241,7 +1241,7 @@ int main(int argc,char *argv[])
}
#ifdef HAVE_READLINE
- initialize_readline((char*) my_progname);
+ initialize_readline();
if (!status.batch && !quick && !opt_html && !opt_xml)
{
/* read-history from file, default ~/.mysql_history*/
@@ -2668,10 +2668,11 @@ static int fake_magic_space(const char *, int)
}
-static void initialize_readline (char *name)
+static void initialize_readline ()
{
/* Allow conditional parsing of the ~/.inputrc file. */
- rl_readline_name = name;
+ rl_readline_name= "mysql";
+ rl_terminal_name= getenv("TERM");
/* Tell the completer that we want a crack first. */
#if defined(USE_NEW_READLINE_INTERFACE)