/*
** static prototypes
*/
-static int sendsbr(char **, int, char *, struct stat *, int);
+static int sendsbr(char **, int, char *, struct stat *);
static void armed_done(int) NORETURN;
static void anno(struct stat *);
static int sendaux(char **, int, char *, struct stat *);
}
for (msgnum = 0; msgnum < nfiles; msgnum++) {
- switch (sendsbr(vec, vecp, files[msgnum], &st, 1)) {
+ switch (sendsbr(vec, vecp, files[msgnum], &st)) {
case DONE:
done(++status);
case NOTOK:
** message sending back-end
*/
static int
-sendsbr(char **vec, int vecp, char *drft, struct stat *st, int rename_drft)
+sendsbr(char **vec, int vecp, char *drft, struct stat *st)
{
int status;
char buffer[BUFSIZ];
case OK:
status = sendaux(vec, vecp, drft, st) ? NOTOK : OK;
/* rename the original draft */
- if (rename_drft && status == OK &&
- rename(original_draft, strncpy(buffer,
- m_backup(original_draft), sizeof(buffer)))
- == NOTOK) {
- advise(buffer, "unable to rename %s to", drft);
+ if (status == OK) {
+ strncpy(buffer, m_backup(original_draft),
+ sizeof(buffer));
+ if (rename(original_draft, buffer) == NOTOK) {
+ advise(buffer, "unable to rename %s to", drft);
+ }
}
break;