#define TEXTSW 1
{ "textfield field", 0 },
#define NSUBJSW 2
- { "notextfield", 0 },
-#define SUBJSW 3
- { "subject", -3 }, /* backward-compatibility */
-#define LIMSW 4
+ { "notextfield", 2 },
+#define LIMSW 3
{ "limit days", 0 },
-#define NLIMSW 5
- { "nolimit", 0 },
-#define VERBSW 6
+#define NLIMSW 4
+ { "nolimit", 2 },
+#define VERBSW 5
{ "verbose", 0 },
-#define NVERBSW 7
- { "noverbose", 0 },
-#define VERSIONSW 8
- { "version", 0 },
-#define HELPSW 9
+#define NVERBSW 6
+ { "noverbose", 2 },
+#define VERSIONSW 7
+ { "Version", 0 },
+#define HELPSW 8
{ "help", 0 },
{ NULL, 0 }
};
static struct smsg *smsgs;
int nmsgs;
-char *subjsort = (char *) 0; /* sort on subject if != 0 */
-unsigned long datelimit = 0;
+char *subjsort = NULL; /* sort on subject if != 0 */
+time_t datelimit = 0;
int submajor = 0; /* if true, sort on subject-major */
int verbose;
struct msgs *mp;
struct smsg **dlist;
-#ifdef LOCALE
setlocale(LC_ALL, "");
-#endif
invo_name = mhbasename(argv[0]);
/* read user profile/context */
argp[-2]);
continue;
- case SUBJSW:
- subjsort = "subject";
- continue;
case NSUBJSW:
- subjsort = (char *)0;
+ subjsort = NULL;
continue;
case LIMSW:
if (folder)
adios(NULL, "only one folder at a time!");
else
- folder = pluspath(cp);
+ folder = getcpy(expandfol(cp));
} else
app_msgarg(&msgs, cp);
}
- if (!context_find("path"))
- free(path("./", TFOLDER));
if (!msgs.size)
- app_msgarg(&msgs, "all");
+ app_msgarg(&msgs, seq_all);
if (!datesw)
datesw = "date";
if (!folder)
- folder = getfolder(FCUR);
- maildir = m_maildir(folder);
+ folder = getcurfol();
+ maildir = toabsdir(folder);
if (chdir(maildir) == NOTOK)
adios(maildir, "unable to change directory to");
rename_msgs(mp, dlist);
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
** messages in the folder.
*/
- (void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, old);
- (void)snprintf(newbuf, sizeof (newbuf), "%s/%d",
+ snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, old);
+ snprintf(newbuf, sizeof (newbuf), "%s/%d",
mp->foldpath, mp->hghmsg + 1);
ext_hook("ref-hook", f1, newbuf);
** to the real place.
*/
- (void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, new);
+ snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, new);
ext_hook("ref-hook", newbuf, f1);
if (rename(tmpfil, m_name(new)) == NOTOK)