projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Fedora Bug #163760: sbr/context_read.c (context_read): Ensure that the
[mmh]
/
uip
/
mhparse.c
diff --git
a/uip/mhparse.c
b/uip/mhparse.c
index
0813aa7
..
c57e745
100644
(file)
--- a/
uip/mhparse.c
+++ b/
uip/mhparse.c
@@
-3,6
+3,10
@@
* mhparse.c -- routines to parse the contents of MIME messages
*
* $Id$
* mhparse.c -- routines to parse the contents of MIME messages
*
* $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>
@@
-12,7
+16,7
@@
#include <errno.h>
#include <setjmp.h>
#include <signal.h>
#include <errno.h>
#include <setjmp.h>
#include <signal.h>
-#include <zotnet/mts/mts.h>
+#include <h/mts.h>
#include <h/tws.h>
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/tws.h>
#include <h/mime.h>
#include <h/mhparse.h>
@@
-22,7
+26,6
@@
#endif
#endif
-extern int errno;
extern int debugsw;
extern int endian; /* mhmisc.c */
extern int debugsw;
extern int endian; /* mhmisc.c */
@@
-177,7
+180,7
@@
static struct str2init str2ces[] = {
{ "quoted-printable", CE_QUOTED, InitQuoted },
{ "8bit", CE_8BIT, Init7Bit },
{ "7bit", CE_7BIT, Init7Bit },
{ "quoted-printable", CE_QUOTED, InitQuoted },
{ "8bit", CE_8BIT, Init7Bit },
{ "7bit", CE_7BIT, Init7Bit },
- { "binary", CE_BINARY, NULL },
+ { "binary", CE_BINARY, Init7Bit },
{ NULL, CE_EXTENSION, NULL }, /* these two must be last! */
{ NULL, CE_UNKNOWN, NULL },
};
{ NULL, CE_EXTENSION, NULL }, /* these two must be last! */
{ NULL, CE_UNKNOWN, NULL },
};
@@
-256,7
+259,6
@@
parse_mime (char *file)
if (!(ct = get_content (fp, file, 1))) {
if (is_stdin)
unlink (file);
if (!(ct = get_content (fp, file, 1))) {
if (is_stdin)
unlink (file);
- fclose (fp);
advise (NULL, "unable to decode %s", file);
return NULL;
}
advise (NULL, "unable to decode %s", file);
return NULL;
}
@@
-290,6
+292,7
@@
parse_mime (char *file)
* toplevel = 0 # we are inside message type or multipart type
* # other than multipart/digest
* toplevel = -1 # we are inside multipart/digest
* toplevel = 0 # we are inside message type or multipart type
* # other than multipart/digest
* toplevel = -1 # we are inside multipart/digest
+ * NB: on failure we will fclose(in)!
*/
static CT
*/
static CT
@@
-984,6
+987,7
@@
InitMultiPart (CT ct)
* Check for "boundary" parameter, which is
* required for multipart messages.
*/
* Check for "boundary" parameter, which is
* required for multipart messages.
*/
+ bp = 0;
for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) {
if (!strcasecmp (*ap, "boundary")) {
bp = *ep;
for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) {
if (!strcasecmp (*ap, "boundary")) {
bp = *ep;
@@
-1052,7
+1056,6
@@
next_part:
if (!(p = get_content (fp, ct->c_file,
ct->c_subtype == MULTI_DIGEST ? -1 : 0))) {
if (!(p = get_content (fp, ct->c_file,
ct->c_subtype == MULTI_DIGEST ? -1 : 0))) {
- fclose (ct->c_fp);
ct->c_fp = NULL;
return NOTOK;
}
ct->c_fp = NULL;
return NOTOK;
}
@@
-1281,7
+1284,6
@@
invalid_param:
fseek (fp = ct->c_fp, ct->c_begin, SEEK_SET);
if (!(p = get_content (fp, ct->c_file, 0))) {
fseek (fp = ct->c_fp, ct->c_begin, SEEK_SET);
if (!(p = get_content (fp, ct->c_file, 0))) {
- fclose (ct->c_fp);
ct->c_fp = NULL;
return NOTOK;
}
ct->c_fp = NULL;
return NOTOK;
}