projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drop str_[n]cat.
[apps/madmutt.git]
/
compose.c
diff --git
a/compose.c
b/compose.c
index
8c0006a
..
a0eb9ac
100644
(file)
--- a/
compose.c
+++ b/
compose.c
@@
-16,6
+16,9
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
#include "mutt.h"
#include "enter.h"
#include "mutt.h"
#include "enter.h"
@@
-41,9
+44,6
@@
#include "nntp.h"
#endif
#include "nntp.h"
#endif
-#include "lib/mem.h"
-#include "lib/intl.h"
-#include "lib/str.h"
#include <errno.h>
#include <string.h>
#include <errno.h>
#include <string.h>
@@
-224,14
+224,14
@@
static void redraw_mix_line (LIST * chain)
if (t && t[0] == '0' && t[1] == '\0')
t = "<random>";
if (t && t[0] == '0' && t[1] == '\0')
t = "<random>";
- if (c +
str_len
(t) + 2 >= COLS - SW)
+ if (c +
m_strlen
(t) + 2 >= COLS - SW)
break;
addstr (NONULL (t));
if (chain->next)
addstr (", ");
break;
addstr (NONULL (t));
if (chain->next)
addstr (", ");
- c +=
str_len
(t) + 2;
+ c +=
m_strlen
(t) + 2;
}
}
#endif /* MIXMASTER */
}
}
#endif /* MIXMASTER */
@@
-480,7
+480,7
@@
static const char *compose_format_str (char *buf, size_t buflen, char op,
break;
case 'v':
break;
case 'v':
-
strncpy (buf, mutt_make_version (0), buflen
);
+
m_strcpy(buf, buflen, mutt_make_version (0)
);
break;
case 0:
break;
case 0:
@@
-622,7
+622,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
&& buf[0]) {
p_delete(&msg->env->newsgroups);
str_skip_trailws (buf);
&& buf[0]) {
p_delete(&msg->env->newsgroups);
str_skip_trailws (buf);
- msg->env->newsgroups =
str_dup
(str_skip_initws (buf));
+ msg->env->newsgroups =
m_strdup
(str_skip_initws (buf));
move (HDR_TO, HDR_XOFFSET);
clrtoeol ();
if (msg->env->newsgroups)
move (HDR_TO, HDR_XOFFSET);
clrtoeol ();
if (msg->env->newsgroups)
@@
-640,7
+640,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
&& buf[0]) {
p_delete(&msg->env->followup_to);
str_skip_trailws (buf);
&& buf[0]) {
p_delete(&msg->env->followup_to);
str_skip_trailws (buf);
- msg->env->followup_to =
str_dup
(str_skip_initws (buf));
+ msg->env->followup_to =
m_strdup
(str_skip_initws (buf));
move (HDR_CC, HDR_XOFFSET);
clrtoeol ();
if (msg->env->followup_to)
move (HDR_CC, HDR_XOFFSET);
clrtoeol ();
if (msg->env->followup_to)
@@
-657,7
+657,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
if (mutt_get_field ("X-Comment-To: ", buf, sizeof (buf), 0) == 0
&& buf[0]) {
p_delete(&msg->env->x_comment_to);
if (mutt_get_field ("X-Comment-To: ", buf, sizeof (buf), 0) == 0
&& buf[0]) {
p_delete(&msg->env->x_comment_to);
- msg->env->x_comment_to =
str_dup
(buf);
+ msg->env->x_comment_to =
m_strdup
(buf);
move (HDR_BCC, HDR_XOFFSET);
clrtoeol ();
if (msg->env->x_comment_to)
move (HDR_BCC, HDR_XOFFSET);
clrtoeol ();
if (msg->env->x_comment_to)
@@
-697,7
+697,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_MESSAGE:
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_MESSAGE:
- if (Editor && (
str_cmp
("builtin", Editor) != 0)
+ if (Editor && (
m_strcmp
("builtin", Editor) != 0)
&& !option (OPTEDITHDRS)) {
mutt_edit_file (Editor, msg->content->filename);
mutt_update_encoding (msg->content);
&& !option (OPTEDITHDRS)) {
mutt_edit_file (Editor, msg->content->filename);
mutt_update_encoding (msg->content);
@@
-707,10
+707,11
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
}
/* fall through */
case OP_COMPOSE_EDIT_HEADERS:
}
/* fall through */
case OP_COMPOSE_EDIT_HEADERS:
- if (
str_cmp
("builtin", Editor) != 0 &&
+ if (
m_strcmp
("builtin", Editor) != 0 &&
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
- const char *tag = NULL, *err = NULL;
+ const char *tag = NULL;
+ char *err = NULL;
mutt_env_to_local (msg->env);
mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
mutt_env_to_local (msg->env);
mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
@@
-751,7
+752,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
if (!(WithCrypto & APPLICATION_PGP))
break;
if (idxlen == idxmax) {
if (!(WithCrypto & APPLICATION_PGP))
break;
if (idxlen == idxmax) {
-
mem_realloc (&idx, sizeof (ATTACHPTR *) * (idxmax += 5)
);
+
p_realloc(&idx, idxmax += 5
);
menu->data = idx;
}
menu->data = idx;
}
@@
-791,8
+792,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
break;
if (idxlen + numfiles >= idxmax) {
break;
if (idxlen + numfiles >= idxmax) {
- mem_realloc (&idx,
- sizeof (ATTACHPTR *) * (idxmax += 5 + numfiles));
+ p_realloc(&idx, idxmax += 5 + numfiles);
menu->data = idx;
}
menu->data = idx;
}
@@
-919,9
+919,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
}
if (idxlen + Context->tagged >= idxmax) {
}
if (idxlen + Context->tagged >= idxmax) {
- mem_realloc (&idx,
- sizeof (ATTACHPTR *) * (idxmax +=
- 5 + Context->tagged));
+ p_realloc(&idx, idxmax += 5 + Context->tagged);
menu->data = idx;
}
menu->data = idx;
}
@@
-1193,7
+1191,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
continue;
}
if (idxlen == idxmax) {
continue;
}
if (idxlen == idxmax) {
-
mem_realloc (&idx, sizeof (ATTACHPTR *) * (idxmax += 5)
);
+
p_realloc(&idx, idxmax += 5
);
menu->data = idx;
}
menu->data = idx;
}