From: Ori Avtalion Date: Mon, 20 Jun 2011 22:33:32 +0000 (+0300) Subject: [pop3] remove extra space in LIST command X-Git-Tag: upstream/7.37.1~3977^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af6dcc92d56c8913a49a4c8b776f65c717f242d6;p=platform%2Fupstream%2Fcurl.git [pop3] remove extra space in LIST command Some servers, e.g. mail.bezeqint.net:110, consider it a syntax error --- diff --git a/lib/pop3.c b/lib/pop3.c index 0581c58..dc5a1c2 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -481,11 +481,14 @@ static CURLcode pop3_list(struct connectdata *conn) CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; - result = Curl_pp_sendf(&conn->proto.pop3c.pp, "LIST %s", pop3c->mailbox); + if(pop3c->mailbox[0] != '\0') + result = Curl_pp_sendf(&conn->proto.pop3c.pp, "LIST %s", pop3c->mailbox); + else + result = Curl_pp_sendf(&conn->proto.pop3c.pp, "LIST"); if(result) return result; - if(strlen(pop3c->mailbox)) + if(pop3c->mailbox[0] != '\0') state(conn, POP3_LIST_SINGLE); else state(conn, POP3_LIST); diff --git a/tests/data/test810 b/tests/data/test810 index d4f7597..1c31042 100644 --- a/tests/data/test810 +++ b/tests/data/test810 @@ -38,7 +38,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret USER user PASS secret -LIST +LIST QUIT diff --git a/tests/data/test811 b/tests/data/test811 index 850e5e2..ca107ab 100644 --- a/tests/data/test811 +++ b/tests/data/test811 @@ -36,7 +36,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret USER user PASS secret -LIST +LIST QUIT