aboutsummaryrefslogtreecommitdiff
path: root/lib/pop3.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-03-03 13:36:12 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-03-03 13:36:12 +0000
commit757aa7b09d37cc5ad32a549c5ead0096bc4df28b (patch)
tree6cc0e3b400dea7d7a5a701bd21e056123d7e07f8 /lib/pop3.c
parentb1ebf4bda110dda64b89bffcf7286dda908d3689 (diff)
pop3: 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/pop3.c')
-rw-r--r--lib/pop3.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index 69638a946..d809b488a 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -389,12 +389,10 @@ static CURLcode pop3_state_capa(struct connectdata *conn)
/* Send the CAPA command */
result = Curl_pp_sendf(&pop3c->pp, "CAPA");
- if(result)
- return result;
-
- state(conn, POP3_CAPA);
+ if(!result)
+ state(conn, POP3_CAPA);
- return CURLE_OK;
+ return result;
}
static CURLcode pop3_state_starttls(struct connectdata *conn)
@@ -446,12 +444,10 @@ static CURLcode pop3_state_user(struct connectdata *conn)
/* Send the USER command */
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "USER %s",
conn->user ? conn->user : "");
- if(result)
- return result;
-
- state(conn, POP3_USER);
+ if(!result)
+ state(conn, POP3_USER);
- return CURLE_OK;
+ return result;
}
#ifndef CURL_DISABLE_CRYPTO_AUTH
@@ -1021,10 +1017,8 @@ static CURLcode pop3_state_user_resp(struct connectdata *conn, int pop3code,
/* Send the PASS command */
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "PASS %s",
conn->passwd ? conn->passwd : "");
- if(result)
- return result;
-
- state(conn, POP3_PASS);
+ if(!result)
+ state(conn, POP3_PASS);
return result;
}
@@ -1078,10 +1072,8 @@ static CURLcode pop3_command(struct connectdata *conn)
(pop3->custom && pop3->custom[0] != '\0' ?
pop3->custom : command));
- if(result)
- return result;
-
- state(conn, POP3_COMMAND);
+ if(!result)
+ state(conn, POP3_COMMAND);
return result;
}