* rmm.c -- remove a message(s)
*
* $Id$
+ *
+ * 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.
*/
#include <h/mh.h>
+#include <h/utils.h>
/*
* We allocate space for message names and ranges
*/
nummsgs = 0;
maxmsgs = MAXMSGS;
- if (!(msgs = (char **) malloc ((size_t) (maxmsgs * sizeof(*msgs)))))
- adios (NULL, "unable to allocate storage");
+ msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
/* parse arguments */
while ((cp = *argp++)) {
*/
if (nummsgs >= maxmsgs){
maxmsgs += MAXMSGS;
- if (!(msgs = (char **) realloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)))))
- adios (NULL, "unable to reallocate msgs storage");
+ msgs = (char **) mh_xrealloc (msgs,
+ (size_t) (maxmsgs * sizeof(*msgs)));
}
msgs[nummsgs++] = cp;
}
}
/* "remove" the SELECTED messages */
- folder_delmsgs (mp, unlink_msgs);
+ folder_delmsgs (mp, unlink_msgs, 0);
seq_save (mp); /* synchronize message sequences */
context_replace (pfolder, folder); /* update current folder */