From 508cdf4da4d767b76ff8198f11fd8ae6128144ad Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Tue, 12 Feb 2013 23:00:34 +0000 Subject: email: Another post optimisation of endofresp() tidy up --- lib/imap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/imap.c') diff --git a/lib/imap.c b/lib/imap.c index 320101b5d..27e67ff00 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -339,6 +339,7 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, if(len >= id_len + 3) { if(!memcmp(id, line, id_len) && line[id_len] == ' ') { *resp = line[id_len + 1]; /* O, N or B */ + return TRUE; } } @@ -347,6 +348,7 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, if((len == 3 && !memcmp("+", line, 1)) || (len >= 2 && !memcmp("+ ", line, 2))) { *resp = '+'; + return TRUE; } @@ -416,12 +418,12 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, } } } - /* Are we processing FETCH command responses? */ - if(imapc->state == IMAP_FETCH) { + else if(imapc->state == IMAP_FETCH) { /* Do we have a valid response? */ if(len >= 2 && !memcmp("* ", line, 2)) { *resp = '*'; + return TRUE; } } -- cgit v1.2.3