aboutsummaryrefslogtreecommitdiff
path: root/lib/imap.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-02-27 20:53:34 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-02-27 20:53:34 +0000
commitf53ed631b325c82097d3511c44671348d178882f (patch)
treeee67d8399392be615af89757f3582c05bfd1f62a /lib/imap.c
parent5b3736b5333f548069c8588f252ba88b0dd3294d (diff)
imap: Reversed the logic of the (un)successful tagged SELECT response
Reversed the logic of the unsuccessful vs successful tagged SELECT response in imap_state_select_resp() to be more logical to read.
Diffstat (limited to 'lib/imap.c')
-rw-r--r--lib/imap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/imap.c b/lib/imap.c
index cfde0019a..ae2fd4102 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -1233,11 +1233,7 @@ static CURLcode imap_state_select_resp(struct connectdata *conn,
imapc->mailbox_uidvalidity = strdup(tmp);
}
}
- else if(imapcode != 'O') {
- failf(data, "Select failed");
- result = CURLE_LOGIN_DENIED;
- }
- else {
+ else if(imapcode == 'O') {
/* Check if the UIDVALIDITY has been specified and matches */
if(imap->uidvalidity && imapc->mailbox_uidvalidity &&
strcmp(imap->uidvalidity, imapc->mailbox_uidvalidity)) {
@@ -1251,6 +1247,10 @@ static CURLcode imap_state_select_resp(struct connectdata *conn,
result = imap_fetch(conn);
}
}
+ else {
+ failf(data, "Select failed");
+ result = CURLE_LOGIN_DENIED;
+ }
return result;
}