char *cp, *maildir, *datesw = NULL;
char *folder = NULL, buf[BUFSIZ], **argp;
char *cp, *maildir, *datesw = NULL;
char *folder = NULL, buf[BUFSIZ], **argp;
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- if (!(msgs = (char **) realloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)))))
- adios (NULL, "unable to reallocate msgs storage");
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
struct smsg **slist, **flist;
register struct smsg ***il, **fp, **dp;
struct smsg **slist, **flist;
register struct smsg ***il, **fp, **dp;
memcpy((char *)slist, (char *)dlist, (nmsgs+1)*sizeof(*slist));
qsort((char *)slist, nmsgs, sizeof(*slist), (qsort_comp) subsort);
memcpy((char *)slist, (char *)dlist, (nmsgs+1)*sizeof(*slist));
qsort((char *)slist, nmsgs, sizeof(*slist), (qsort_comp) subsort);
* make up the final list, chronological but with
* all the same subjects grouped together.
*/
* make up the final list, chronological but with
* all the same subjects grouped together.
*/
datecomp = add (buf, datecomp);
while (state == FLDPLUS) {
state = m_getfld (state, nam, buf, sizeof(buf), in);
datecomp = add (buf, datecomp);
while (state == FLDPLUS) {
state = m_getfld (state, nam, buf, sizeof(buf), in);
subjcomp = add (buf, subjcomp);
while (state == FLDPLUS) {
state = m_getfld (state, nam, buf, sizeof(buf), in);
subjcomp = add (buf, subjcomp);
while (state == FLDPLUS) {
state = m_getfld (state, nam, buf, sizeof(buf), in);
(void)snprintf(oldname, sizeof (oldname), "%s/%d", mp->foldpath, old);
(void)snprintf(newbuf, sizeof (newbuf), "%s/%d", mp->foldpath, new);
ext_hook("ref-hook", oldname, newbuf);
(void)snprintf(oldname, sizeof (oldname), "%s/%d", mp->foldpath, old);
(void)snprintf(newbuf, sizeof (newbuf), "%s/%d", mp->foldpath, new);
ext_hook("ref-hook", oldname, newbuf);
- * Run the external hook to refile the old message as message
- * number 2147483647. This is our way of making a temporary
- * message number. I don't really like this.
+ * Run the external hook to refile the old message as the
+ * temporary message number that is off of the end of the
+ * messages in the folder.
*/
(void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, old);
*/
(void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, old);
- (void)snprintf(newbuf, sizeof (newbuf), "%s/2147483647", mp->foldpath);
+ (void)snprintf(newbuf, sizeof (newbuf), "%s/%d", mp->foldpath, mp->hghmsg + 1);
get_msg_flags (mp, &tmpset, old);
rename_chain (mp, mlist, j, i);
get_msg_flags (mp, &tmpset, old);
rename_chain (mp, mlist, j, i);
(void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, new);
ext_hook("ref-hook", newbuf, f1);
(void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, new);
ext_hook("ref-hook", newbuf, f1);