summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-06-21 08:54:25 -0700
committerDaniel Stenberg <daniel@haxx.se>2011-06-21 08:54:25 -0700
commit1614dc07452d50c017e29a69923ca339ec7fe859 (patch)
tree96160a7b51074ed947159bd95727b354d64ded1d
parent57064e4a0d426eeb0f82e7831214caaf9300bc2a (diff)
parentaf6dcc92d56c8913a49a4c8b776f65c717f242d6 (diff)
downloadgnurl-1614dc07452d50c017e29a69923ca339ec7fe859.tar.gz
gnurl-1614dc07452d50c017e29a69923ca339ec7fe859.tar.bz2
gnurl-1614dc07452d50c017e29a69923ca339ec7fe859.zip
Merge pull request #23 from salty-horse/pop3_list_space
[pop3] remove extra space in LIST command
-rw-r--r--lib/pop3.c7
-rw-r--r--tests/data/test8102
-rw-r--r--tests/data/test8112
3 files changed, 7 insertions, 4 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index 0581c58b0..dc5a1c2fa 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 d4f75972a..1c31042b6 100644
--- a/tests/data/test810
+++ b/tests/data/test810
@@ -38,7 +38,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret
<protocol>
USER user
PASS secret
-LIST
+LIST
QUIT
</protocol>
</verify>
diff --git a/tests/data/test811 b/tests/data/test811
index 850e5e27d..ca107abcc 100644
--- a/tests/data/test811
+++ b/tests/data/test811
@@ -36,7 +36,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret
<protocol>
USER user
PASS secret
-LIST
+LIST
QUIT
</protocol>
</verify>