Commit c277c43a authored by Sergei Golubchik's avatar Sergei Golubchik

fix dialog plugin to work again

(fgets, unlike gets, does not strip \n)
parent 6e294768
......@@ -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;
}
......
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