mirror of
https://github.com/MariaDB/server.git
synced 2026-04-20 15:25:33 +02:00
fix dialog plugin to work again
(fgets, unlike gets, does not strip \n)
This commit is contained in:
parent
6e294768dc
commit
c277c43a30
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue