Commit 98b24da0 authored by Aleksey Midenkov's avatar Aleksey Midenkov

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
parent 22914ec7
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment