maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #02912
Rev 2781: fix dialog plugin to work again in http://bazaar.launchpad.net/~maria-captains/maria/5.2/
At http://bazaar.launchpad.net/~maria-captains/maria/5.2/
------------------------------------------------------------
revno: 2781
revision-id: sergii@xxxxxxxxx-20100408135804-rel674ezvlwfj3ax
parent: monty@xxxxxxxxxxxx-20100408130743-uw4igobwa9mw59n1
committer: Sergei Golubchik <sergii@xxxxxxxxx>
branch nick: 5.2
timestamp: Thu 2010-04-08 15:58:04 +0200
message:
fix dialog plugin to work again
(fgets, unlike gets, does not strip \n)
=== modified file 'plugin/auth/dialog.c'
--- a/plugin/auth/dialog.c 2010-04-08 13:02:49 +0000
+++ b/plugin/auth/dialog.c 2010-04-08 13:58:04 +0000
@@ -226,11 +226,17 @@ static char *builtin_ask(MYSQL *mysql __
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;
}