* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
/* This keeps compiler happy on calls to qsort */
typedef int (*qsort_comp) (const void *, const void *);
/* This keeps compiler happy on calls to qsort */
typedef int (*qsort_comp) (const void *, const void *);
char *folder = NULL, buf[BUFSIZ], **argp;
char **arguments;
struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
struct smsg **dlist;
char *folder = NULL, buf[BUFSIZ], **argp;
char **arguments;
struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
struct smsg **dlist;
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
invo_name);
print_help (buf, switches, 1);
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
invo_name);
print_help (buf, switches, 1);
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (!context_find ("path"))
free (path ("./", TFOLDER));
- if (!msgs.size)
- app_msgarg(&msgs, "all");
+ if (!msgs.size) {
+ if (allmsgs) {
+ app_msgarg(&msgs, "all");
+ } else {
+ adios (NULL, "must specify messages to sort with -noall");
+ }
+ }
if ((nmsgs = read_hdrs (mp, datesw)) <= 0)
adios (NULL, "no messages to sort");
if ((nmsgs = read_hdrs (mp, datesw)) <= 0)
adios (NULL, "no messages to sort");
- printf ("sorting by %s-major %s-minor\n",
- submajor ? subjsort : datesw,
- submajor ? datesw : subjsort);
+ if (submajor)
+ printf ("sorting by %s\n", subjsort);
+ else
+ printf ("sorting by %s-major %s-minor\n", subjsort, datesw);
seq_save (mp); /* synchronize message sequences */
context_save (); /* save the context file */
folder_free (mp); /* free folder/message structure */
seq_save (mp); /* synchronize message sequences */
context_save (); /* save the context file */
folder_free (mp); /* free folder/message structure */
admonish (NULL, "can't parse %s field in message %d", datesw, msg);
fstat (fileno (in), &st);
smsg->s_clock = st.st_mtime;
admonish (NULL, "can't parse %s field in message %d", datesw, msg);
fstat (fileno (in), &st);
smsg->s_clock = st.st_mtime;