]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
[pop3] remove extra space in LIST command 23/head
authorOri Avtalion <ori@avtalion.name>
Mon, 20 Jun 2011 22:33:32 +0000 (01:33 +0300)
committerOri Avtalion <ori@avtalion.name>
Tue, 21 Jun 2011 15:12:05 +0000 (18:12 +0300)
Some servers, e.g. mail.bezeqint.net:110, consider it a syntax error

lib/pop3.c
tests/data/test810
tests/data/test811

index 0581c58b019d85a3bad66c00be7fe6dbb284e19d..dc5a1c2fa2165cd319a56de62921108a811aaa40 100644 (file)
@@ -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);
index d4f75972a7bca45d5f3d734bbd18833af7a25330..1c31042b69ff47c60243deca18d41e89ee7b118f 100644 (file)
@@ -38,7 +38,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret
 <protocol>
 USER user\r
 PASS secret\r
-LIST \r
+LIST\r
 QUIT\r
 </protocol>
 </verify>
index 850e5e27d306feb132d2b502d25c2497f830cd9d..ca107abccc8b984887ba33198f13d071bac98fda 100644 (file)
@@ -36,7 +36,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret
 <protocol>
 USER user\r
 PASS secret\r
-LIST \r
+LIST\r
 QUIT\r
 </protocol>
 </verify>