From c277c43a30c8e1d4177ccf7630b9c4c808a20010 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 8 Apr 2010 15:58:04 +0200 Subject: [PATCH] fix dialog plugin to work again (fgets, unlike gets, does not strip \n) --- plugin/auth/dialog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c index 4fa1b5e66e5..72c6364f49a 100644 --- a/plugin/auth/dialog.c +++ b/plugin/auth/dialog.c @@ -226,11 +226,17 @@ static char *builtin_ask(MYSQL *mysql __attribute__((unused)), const char *prompt, char *buf, int buf_len) { + int len; + fputs(prompt, stdout); fputc(' ', stdout); if (fgets(buf, buf_len, stdin) == 0) return 0; + len= strlen(buf); + if (len && buf[len-1]=='\n') + buf[len-1]=0; + return buf; }