aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-02-28 22:46:22 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-02-28 22:46:22 +0000
commitb06a78622609d2016c140599e9380db5f200c10a (patch)
treef4c03551de39749a8317c6dd344aa94c23a77e4d /lib
parentb4eb08e7fb0eef68772258acec4fbd21029b78ae (diff)
imap: Updated the coding style for state changes after a send operation
Some state changes would be performed after a failure test that performed a hard return, whilst others would be performed within a test for success. Updated the code, for consistency, so all instances are performed within a success test.
Diffstat (limited to 'lib')
-rw-r--r--lib/imap.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/imap.c b/lib/imap.c
index e67d6a5c3..c9e2a1923 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -492,10 +492,8 @@ static CURLcode imap_state_capability(struct connectdata *conn)
/* Send the CAPABILITY command */
result = imap_sendf(conn, "CAPABILITY");
- if(result)
- return result;
-
- state(conn, IMAP_CAPABILITY);
+ if(!result)
+ state(conn, IMAP_CAPABILITY);
return CURLE_OK;
}
@@ -559,10 +557,8 @@ static CURLcode imap_state_login(struct connectdata *conn)
Curl_safefree(user);
Curl_safefree(passwd);
- if(result)
- return result;
-
- state(conn, IMAP_LOGIN);
+ if(!result)
+ state(conn, IMAP_LOGIN);
return CURLE_OK;
}
@@ -686,10 +682,8 @@ static CURLcode imap_select(struct connectdata *conn)
result = imap_sendf(conn, "SELECT %s", mailbox);
Curl_safefree(mailbox);
- if(result)
- return result;
-
- state(conn, IMAP_SELECT);
+ if(!result)
+ state(conn, IMAP_SELECT);
return result;
}
@@ -703,10 +697,8 @@ static CURLcode imap_fetch(struct connectdata *conn)
result = imap_sendf(conn, "FETCH %s BODY[%s]",
imap->uid ? imap->uid : "1",
imap->section ? imap->section : "");
- if(result)
- return result;
-
- state(conn, IMAP_FETCH);
+ if(!result)
+ state(conn, IMAP_FETCH);
return result;
}