X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a57e5d9907d845d6f83d2cfdea55cd52efad793f..63621a81d16ab743de6b57d47578a9a2c670ad22:/uip/refile.c diff --git a/uip/refile.c b/uip/refile.c index 5d03d4d1..bed5cba6 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -1,6 +1,4 @@ - -/* - * refile.c -- move or link message(s) from a source folder +/* refile.c -- move or link message(s) from a source folder * -- into one or more destination folders * * This code is Copyright (c) 2002, by the authors of nmh. See the @@ -10,6 +8,8 @@ #include #include +#include "sbr/m_maildir.h" +#include "sbr/m_mktemp.h" #include #define REFILE_SWITCHES \ @@ -217,7 +217,7 @@ main (int argc, char **argv) */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) { - cp = getcpy (m_name (msgnum)); + cp = mh_xstrdup(m_name (msgnum)); if (m_file (mp, cp, retainseqs ? msgnum : 0, folders, foldp, preserve, !linkf)) done (1); @@ -275,8 +275,8 @@ static void opnfolds (struct msgs *src_folder, struct st_fold *folders, int nfolders) { char nmaildir[BUFSIZ]; - register struct st_fold *fp, *ep; - register struct msgs *mp; + struct st_fold *fp, *ep; + struct msgs *mp; for (fp = folders, ep = folders + nfolders; fp < ep; fp++) { if (chdir (m_maildir ("")) < 0) { @@ -312,15 +312,15 @@ opnfolds (struct msgs *src_folder, struct st_fold *folders, int nfolders) /* - * Set the Previous-Sequence and then sychronize the + * Set the Previous-Sequence and then synchronize the * sequence file, for each destination folder. */ static void clsfolds (struct st_fold *folders, int nfolders) { - register struct st_fold *fp, *ep; - register struct msgs *mp; + struct st_fold *fp, *ep; + struct msgs *mp; for (fp = folders, ep = folders + nfolders; fp < ep; fp++) { mp = fp->f_mp; @@ -384,7 +384,7 @@ m_file (struct msgs *mp, char *msgfile, int oldmsgnum, * therefore won't be assigned to be the current message. */ if ((msgnum = folder_addmsg (&fp->f_mp, msgfile, - mp == fp->f_mp ? 0 : 1, + mp != fp->f_mp, 0, preserve, nfolders == 1 && refile, maildir)) == -1) return 1; @@ -411,7 +411,7 @@ copy_seqs (struct msgs *oldmp, int oldmsgnum, struct msgs *newmp, int newmsgnum) assert ((int) seqnum == seq_getnum (oldmp, *seq)); if (in_sequence (oldmp, seqnum, oldmsgnum)) { seq_addmsg (newmp, *seq, newmsgnum, - is_seq_private (oldmp, seqnum) ? 0 : 1, 0); + !is_seq_private (oldmp, seqnum), 0); } } }