Print a warning if input is requested while disabled

This commit is contained in:
styan 2020-05-09 03:10:09 +00:00
parent afc778096e
commit 8cc906d526
1 changed files with 7 additions and 3 deletions

View File

@ -122,9 +122,13 @@ main(int argc, char *argv[])
query = NULL;
switch (gemini.status / 10) {
case 1:
if (prompt > 0 && readpassphrase(gemini.meta, b,
sizeof(b), prompt > 1 ? RPP_ECHO_OFF :
RPP_ECHO_ON) == NULL) {
if (prompt == 0) {
warnx("User-input is not enabled");
break;
}
if (readpassphrase(gemini.meta, b, sizeof(b),
prompt > 1 ? RPP_ECHO_OFF : RPP_ECHO_ON)
== NULL) {
warn("Could not get user-input");
goto err;
}