From: Pierre Habouzit Date: Wed, 16 May 2007 18:08:05 +0000 (+0200) Subject: pop fixes. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=a31de505502560546791fc0158b03c41b7a721ec;p=apps%2Fmadmutt.git pop fixes. Signed-off-by: Pierre Habouzit --- diff --git a/pop.c b/pop.c index 3cfb694..30dcf2d 100644 --- a/pop.c +++ b/pop.c @@ -155,7 +155,7 @@ static pop_query_status pop_connect(pop_data_t * pop_data) p_delete(&pop_data->timestamp); if ((p = strchr(buf, '<')) && (q = strchr(p, '>'))) { - pop_data->timestamp = p_dupstr(p, q - p); + pop_data->timestamp = p_dupstr(p, q + 1 - p); } return PQ_OK; } @@ -1217,18 +1217,18 @@ void pop_fetch_mail (void) pop_data_t *pop_data; ssize_t plen; - if (!PopHost) { + if (m_strisempty(PopHost)) { mutt_error _("POP host is not defined."); return; } plen = m_strlen(PopHost) + 7; - url = p = p_new(char, plen); + url = p = p_new(char, plen); if (url_check_scheme (PopHost) == U_UNKNOWN) { - plen -= m_strcpy(url, plen, "pop://"); - p += plen; + snprintf(p, plen, "pop://%s", PopHost); + } else { + m_strcpy(p, plen, PopHost); } - m_strcpy(p, plen, PopHost); ret = pop_parse_path (url, &act); p_delete(&url);