projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added -nocontentid (and -contentid, for symmetry) switch to mhbuild. This allows...
[mmh]
/
uip
/
mhbuildsbr.c
diff --git
a/uip/mhbuildsbr.c
b/uip/mhbuildsbr.c
index
7e80565
..
83a18b5
100644
(file)
--- a/
uip/mhbuildsbr.c
+++ b/
uip/mhbuildsbr.c
@@
-3,6
+3,10
@@
* mhbuildsbr.c -- routines to expand/translate MIME composition files
*
* $Id$
* mhbuildsbr.c -- routines to expand/translate MIME composition files
*
* $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.
*/
/*
*/
/*
@@
-19,10
+23,11
@@
#include <h/md5.h>
#include <errno.h>
#include <signal.h>
#include <h/md5.h>
#include <errno.h>
#include <signal.h>
-#include <zotnet/mts/mts.h>
-#include <zotnet/tws/tws.h>
+#include <h/mts.h>
+#include <h/tws.h>
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/mime.h>
#include <h/mhparse.h>
+#include <h/utils.h>
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
@@
-40,14
+45,13
@@
#endif
#endif
-extern int errno;
-
extern int debugsw;
extern int verbosw;
extern int ebcdicsw;
extern int listsw;
extern int rfc934sw;
extern int debugsw;
extern int verbosw;
extern int ebcdicsw;
extern int listsw;
extern int rfc934sw;
+extern int contentidsw;
extern int endian; /* mhmisc.c */
extern int endian; /* mhmisc.c */
@@
-783,8
+787,7
@@
add_header (CT ct, char *name, char *value)
HF hp;
/* allocate header field structure */
HF hp;
/* allocate header field structure */
- if (!(hp = malloc (sizeof(*hp))))
- adios (NULL, "out of memory");
+ hp = mh_xmalloc (sizeof(*hp));
/* link data into header structure */
hp->name = name;
/* link data into header structure */
hp->name = name;
@@
-1551,8
+1554,7
@@
invalid_param:
goto no_body;
}
goto no_body;
}
- if ((e->eb_body = bp = malloc ((unsigned) size)) == NULL)
- adios (NULL, "out of memory");
+ e->eb_body = bp = mh_xmalloc ((unsigned) size);
fseek (p->c_fp, p->c_begin, SEEK_SET);
while (size > 0)
switch (cc = fread (bp, sizeof(*bp), size, p->c_fp)) {
fseek (p->c_fp, p->c_begin, SEEK_SET);
while (size > 0)
switch (cc = fread (bp, sizeof(*bp), size, p->c_fp)) {
@@
-3931,9
+3933,9
@@
build_headers (CT ct)
add_header (ct, np, vp);
/*
add_header (ct, np, vp);
/*
- * output the Content-ID
+ * output the Content-ID, unless disabled by -nocontentid
*/
*/
- if (ct->c_id) {
+ if (contentidsw && ct->c_id) {
np = add (ID_FIELD, NULL);
vp = concat (" ", ct->c_id, NULL);
add_header (ct, np, vp);
np = add (ID_FIELD, NULL);
vp = concat (" ", ct->c_id, NULL);
add_header (ct, np, vp);