projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use m_strdup and m_strlen that are inlined for efficiency
[apps/madmutt.git]
/
pop
/
pop.c
diff --git
a/pop/pop.c
b/pop/pop.c
index
b8e9e06
..
058fe1d
100644
(file)
--- a/
pop/pop.c
+++ b/
pop/pop.c
@@
-12,6
+12,8
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
#include "mutt.h"
#include "mx.h"
#include "mutt.h"
#include "mx.h"
@@
-19,9
+21,6
@@
#include "mutt_crypt.h"
#include "mutt_curses.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>
#include "lib/debug.h"
#include <string.h>
@@
-143,7
+142,7
@@
static int fetch_uidl (char *line, void *data)
ctx->msgcount++;
ctx->hdrs[i] = mutt_new_header ();
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;
}
else if (ctx->hdrs[i]->index != index - 1)
pop_data->clear_cache = 1;
@@
-249,9
+248,9
@@
int pop_open_mailbox (CONTEXT * ctx)
return -1;
p_delete(&ctx->path);
return -1;
p_delete(&ctx->path);
- ctx->path =
str_dup
(buf);
+ 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;
pop_data->conn = conn;
ctx->data = pop_data;
@@
-406,7
+405,7
@@
int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
* portion of the headers, those required for the main display.
*/
cache->index = h->index;
* 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);
rewind (msg->fp);
uidl = h->data;
mutt_free_envelope (&h->env);
@@
-526,7
+525,7
@@
void pop_fetch_mail (void)
return;
}
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');
if (url_check_scheme (PopHost) == U_UNKNOWN) {
strcpy (url, "pop://"); /* __STRCPY_CHECKED__ */
p = strchr (url, '\0');
@@
-544,7
+543,7
@@
void pop_fetch_mail (void)
if (!conn)
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) {
pop_data->conn = conn;
if (pop_open_connection (pop_data) < 0) {