projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* sbr/m_draft.c, sbr/utils.c, uip/folder.c, uip/inc.c, uip/mhstoresbr.c,
[mmh]
/
uip
/
rmm.c
diff --git
a/uip/rmm.c
b/uip/rmm.c
index
21a0f90
..
b9fd80d
100644
(file)
--- a/
uip/rmm.c
+++ b/
uip/rmm.c
@@
-3,9
+3,14
@@
* rmm.c -- remove a message(s)
*
* $Id$
* 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/mh.h>
+#include <h/utils.h>
/*
* We allocate space for message names and ranges
/*
* We allocate space for message names and ranges
@@
-21,7
+26,7
@@
static struct swit switches[] = {
#define VERSIONSW 2
{ "version", 0 },
#define HELPSW 3
#define VERSIONSW 2
{ "version", 0 },
#define HELPSW 3
- { "help", 4 },
+ { "help", 0 },
{ NULL, 0 }
};
{ NULL, 0 }
};
@@
-52,8
+57,7
@@
main (int argc, char **argv)
*/
nummsgs = 0;
maxmsgs = MAXMSGS;
*/
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++)) {
/* parse arguments */
while ((cp = *argp++)) {
@@
-94,9
+98,8
@@
main (int argc, char **argv)
*/
if (nummsgs >= maxmsgs){
maxmsgs += MAXMSGS;
*/
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;
}
}
msgs[nummsgs++] = cp;
}
@@
-141,7
+144,7
@@
main (int argc, char **argv)
}
/* "remove" the SELECTED messages */
}
/* "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 */
seq_save (mp); /* synchronize message sequences */
context_replace (pfolder, folder); /* update current folder */