# include "config.h"
#endif
+#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
+
#include "mutt.h"
#include "mx.h"
#include "pop.h"
#include "mutt_crypt.h"
#include "mutt_curses.h"
-#include "lib/mem.h"
-#include "lib/str.h"
-#include "lib/intl.h"
#include "lib/debug.h"
#include <string.h>
sscanf (line, "%d %s", &index, line);
for (i = 0; i < ctx->msgcount; i++)
- if (!str_cmp (line, ctx->hdrs[i]->data))
+ if (!m_strcmp(line, ctx->hdrs[i]->data))
break;
if (i == ctx->msgcount) {
ctx->msgcount++;
ctx->hdrs[i] = mutt_new_header ();
- ctx->hdrs[i]->data = str_dup (line);
+ ctx->hdrs[i]->data = m_strdup(line);
}
else if (ctx->hdrs[i]->index != index - 1)
pop_data->clear_cache = 1;
if (!conn)
return -1;
- mem_free (&ctx->path);
- ctx->path = str_dup (buf);
+ p_delete(&ctx->path);
+ ctx->path = m_strdup(buf);
- pop_data = mem_calloc (1, sizeof (POP_DATA));
+ pop_data = p_new(POP_DATA, 1);
pop_data->conn = conn;
ctx->data = pop_data;
for (i = 0; i < POP_CACHE_LEN; i++) {
if (pop_data->cache[i].path) {
unlink (pop_data->cache[i].path);
- mem_free (&pop_data->cache[i].path);
+ p_delete(&pop_data->cache[i].path);
}
}
}
else {
/* clear the previous entry */
unlink (cache->path);
- mem_free (&cache->path);
+ p_delete(&cache->path);
}
}
* portion of the headers, those required for the main display.
*/
cache->index = h->index;
- cache->path = str_dup (path);
+ cache->path = m_strdup(path);
rewind (msg->fp);
uidl = h->data;
mutt_free_envelope (&h->env);
fgets (buf, sizeof (buf), msg->fp);
}
- h->content->length = ftell (msg->fp) - h->content->offset;
+ h->content->length = ftello (msg->fp) - h->content->offset;
/* This needs to be done in case this is a multipart message */
if (!WithCrypto)
return;
}
- url = p = mem_calloc (strlen (PopHost) + 7, sizeof (char));
+ url = p = p_new(char, strlen (PopHost) + 7);
if (url_check_scheme (PopHost) == U_UNKNOWN) {
strcpy (url, "pop://"); /* __STRCPY_CHECKED__ */
p = strchr (url, '\0');
strcpy (p, PopHost); /* __STRCPY_CHECKED__ */
ret = pop_parse_path (url, &acct);
- mem_free (&url);
+ p_delete(&url);
if (ret) {
mutt_error (_("%s is an invalid POP path"), PopHost);
return;
if (!conn)
return;
- pop_data = mem_calloc (1, sizeof (POP_DATA));
+ pop_data = p_new(POP_DATA, 1);
pop_data->conn = conn;
if (pop_open_connection (pop_data) < 0) {
mutt_socket_free (pop_data->conn);
- mem_free (&pop_data);
+ p_delete(&pop_data);
return;
}
if (pop_query (pop_data, buffer, sizeof (buffer)) == PQ_NOT_CONNECTED)
goto fail;
mutt_socket_close (conn);
- mem_free (&pop_data);
+ p_delete(&pop_data);
return;
fail:
mutt_error _("Server closed connection!");
mutt_socket_close (conn);
- mem_free (&pop_data);
+ p_delete(&pop_data);
}