X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=account.c;h=b96de37d000170a0198066a8b0dc5e2f64dd73ea;hb=11dfc0aa39e31496da16c708f972a6718dd7ee5c;hp=0499e0c03b9036a8a9e8c6c9b38ae776ac442eb6;hpb=b4827293ce79b576beb9550b91e71a198f2f5744;p=apps%2Fmadmutt.git diff --git a/account.c b/account.c index 0499e0c..b96de37 100644 --- a/account.c +++ b/account.c @@ -54,11 +54,11 @@ int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2) #endif if (a1->flags & a2->flags & M_ACCT_USER) - return (!safe_strcmp (a1->user, a2->user)); + return (!mutt_strcmp (a1->user, a2->user)); if (a1->flags & M_ACCT_USER) - return (!safe_strcmp (a1->user, user)); + return (!mutt_strcmp (a1->user, user)); if (a2->flags & M_ACCT_USER) - return (!safe_strcmp (a2->user, user)); + return (!mutt_strcmp (a2->user, user)); return 1; } @@ -176,13 +176,18 @@ int mutt_account_getlogin (ACCOUNT* account) #ifdef USE_IMAP else if (account->type == M_ACCT_TYPE_IMAP) { - if (ImapLogin) + if (ImapLogin) { strfcpy (account->login, ImapLogin, sizeof (account->login)); - else - strfcpy (account->login, ImapUser, sizeof (account->login)); + account->flags |= M_ACCT_LOGIN; + } } #endif + if (!(account->flags & M_ACCT_LOGIN)) { + mutt_account_getuser (account); + strfcpy (account->login, account->user, sizeof (account->login)); + } + account->flags |= M_ACCT_LOGIN; return 0; @@ -209,7 +214,8 @@ int mutt_account_getpass (ACCOUNT * account) #endif else { snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "), - account->login, account->host); + account->flags & M_ACCT_LOGIN ? account->login : account->user, + account->host); account->pass[0] = '\0'; if (mutt_get_password (prompt, account->pass, sizeof (account->pass))) return -1;