Commit 81a456b7 81a456b7d5629862e1281a7d1394a8b3d5a1515e by Sergey Poznyakoff

(mhn_store_command): If no message part is available

ignore %p and %P metacharacters.
(store_handler): Unlink the file if it exists.
1 parent f69b3981
Showing 1 changed file with 5 additions and 2 deletions
......@@ -827,10 +827,12 @@ mhn_store_command (message_t msg, msg_part_t part, char *name)
break;
case 'P':
obstack_1grow (&stk, '.');
if (msg_part_level (part) > 1)
obstack_1grow (&stk, '.');
/*FALLTHRU*/
case 'p':
msg_part_format_stk (&stk, part);
if (msg_part_level (part) > 1)
msg_part_format_stk (&stk, part);
break;
case 's':
......@@ -1641,6 +1643,7 @@ store_handler (message_t msg, msg_part_t part, char *type, char *encoding,
free (name);
return 0;
}
unlink (name);
}
rc = file_stream_create (&out, name, MU_STREAM_WRITE|MU_STREAM_CREAT);
......