projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
compose.c
diff --git
a/compose.c
b/compose.c
index
9dc603d
..
f2afd32
100644
(file)
--- a/
compose.c
+++ b/
compose.c
@@
-221,14
+221,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 + s
afe_str
len (t) + 2 >= COLS - SidebarWidth)
+ if (c + s
tr_
len (t) + 2 >= COLS - SidebarWidth)
break;
addstr (NONULL (t));
if (chain->next)
addstr (", ");
break;
addstr (NONULL (t));
if (chain->next)
addstr (", ");
- c += s
afe_str
len (t) + 2;
+ c += s
tr_
len (t) + 2;
}
}
#endif /* MIXMASTER */
}
}
#endif /* MIXMASTER */
@@
-619,7
+619,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
&& buf[0]) {
FREE (&msg->env->newsgroups);
str_skip_trailws (buf);
&& buf[0]) {
FREE (&msg->env->newsgroups);
str_skip_trailws (buf);
- msg->env->newsgroups = s
afe_str
dup (str_skip_initws (buf));
+ msg->env->newsgroups = s
tr_
dup (str_skip_initws (buf));
move (HDR_TO, HDR_XOFFSET);
clrtoeol ();
if (msg->env->newsgroups)
move (HDR_TO, HDR_XOFFSET);
clrtoeol ();
if (msg->env->newsgroups)
@@
-637,7
+637,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
&& buf[0]) {
FREE (&msg->env->followup_to);
str_skip_trailws (buf);
&& buf[0]) {
FREE (&msg->env->followup_to);
str_skip_trailws (buf);
- msg->env->followup_to = s
afe_str
dup (str_skip_initws (buf));
+ msg->env->followup_to = s
tr_
dup (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)
@@
-654,7
+654,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]) {
FREE (&msg->env->x_comment_to);
if (mutt_get_field ("X-Comment-To: ", buf, sizeof (buf), 0) == 0
&& buf[0]) {
FREE (&msg->env->x_comment_to);
- msg->env->x_comment_to = s
afe_str
dup (buf);
+ msg->env->x_comment_to = s
tr_
dup (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)
@@
-694,7
+694,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 && (s
afe_str
cmp ("builtin", Editor) != 0)
+ if (Editor && (s
tr_
cmp ("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);
@@
-704,7
+704,7
@@
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 (s
afe_str
cmp ("builtin", Editor) != 0 &&
+ if (s
tr_
cmp ("builtin", Editor) != 0 &&
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
char *tag = NULL, *err = NULL;
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
char *tag = NULL, *err = NULL;
@@
-801,6
+801,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
char *att = files[i];
idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
char *att = files[i];
idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen]->unowned = 1;
idx[idxlen]->content = mutt_make_file_attach (att);
if (idx[idxlen]->content != NULL)
update_idx (menu, idx, idxlen++);
idx[idxlen]->content = mutt_make_file_attach (att);
if (idx[idxlen]->content != NULL)
update_idx (menu, idx, idxlen++);
@@
-954,6
+955,8
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
case OP_DELETE:
CHECK_COUNT;
case OP_DELETE:
CHECK_COUNT;
+ if (idx[menu->current]->unowned)
+ idx[menu->current]->content->unlink = 0;
if (delete_attachment (menu, &idxlen, menu->current) == -1)
break;
mutt_update_tree (idx, idxlen);
if (delete_attachment (menu, &idxlen, menu->current) == -1)
break;
mutt_update_tree (idx, idxlen);
@@
-1278,6
+1281,8
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
/* avoid freeing other attachments */
idx[idxlen]->content->next = NULL;
idx[idxlen]->content->parts = NULL;
/* avoid freeing other attachments */
idx[idxlen]->content->next = NULL;
idx[idxlen]->content->parts = NULL;
+ if (idx[idxlen]->unowned)
+ idx[idxlen]->content->unlink = 0;
mutt_free_body (&idx[idxlen]->content);
FREE (&idx[idxlen]->tree);
FREE (&idx[idxlen]);
mutt_free_body (&idx[idxlen]->content);
FREE (&idx[idxlen]->tree);
FREE (&idx[idxlen]);