summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 2e9203c..887bb84 100644
--- a/src/main.c
+++ b/src/main.c
@@ -98,17 +98,24 @@ static bool BarMainLoginUser (BarApp_t *app) {
*/
static bool BarMainGetLoginCredentials (BarSettings_t *settings,
BarReadlineFds_t *input) {
+ bool usernameFromConfig = true;
+
if (settings->username == NULL) {
char nameBuf[100];
BarUiMsg (settings, MSG_QUESTION, "Email: ");
BarReadlineStr (nameBuf, sizeof (nameBuf), input, BAR_RL_DEFAULT);
settings->username = strdup (nameBuf);
+ usernameFromConfig = false;
}
if (settings->password == NULL) {
char passBuf[100];
+ if (usernameFromConfig) {
+ BarUiMsg (settings, MSG_QUESTION, "Email: %s\n", settings->username);
+ }
+
if (settings->passwordCmd == NULL) {
BarUiMsg (settings, MSG_QUESTION, "Password: ");
BarReadlineStr (passBuf, sizeof (passBuf), input, BAR_RL_NOECHO);
@@ -163,8 +170,7 @@ static bool BarMainGetLoginCredentials (BarSettings_t *settings,
return false;
}
}
-
- }
+ } /* end else passwordCmd */
}
return true;