projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use context/ctxpath==NULL to indicate that no context file should be read,
[mmh]
/
sbr
/
m_getfld.c
diff --git
a/sbr/m_getfld.c
b/sbr/m_getfld.c
index
4752893
..
1332405
100644
(file)
--- a/
sbr/m_getfld.c
+++ b/
sbr/m_getfld.c
@@
-3,10
+3,14
@@
* m_getfld.c -- read/parse a message
*
* $Id$
* m_getfld.c -- read/parse a message
*
* $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 <zotnet/mts/mts.h>
+#include <h/mts.h>
/* This module has a long and checkered history. First, it didn't burst
maildrops correctly because it considered two CTRL-A:s in a row to be
/* This module has a long and checkered history. First, it didn't burst
maildrops correctly because it considered two CTRL-A:s in a row to be
@@
-184,6
+188,7
@@
static int (*eom_action)() = NULL;
# define _ptr _p /* Gag */
# define _cnt _r /* Retch */
# define _filbuf __srget /* Puke */
# define _ptr _p /* Gag */
# define _cnt _r /* Retch */
# define _filbuf __srget /* Puke */
+# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
#endif
#ifdef SCO_5_STDIO
#endif
#ifdef SCO_5_STDIO
@@
-191,6
+196,11
@@
static int (*eom_action)() = NULL;
# define _cnt __cnt
# define _base __base
# define _filbuf(fp) ((fp)->__cnt = 0, __filbuf(fp))
# define _cnt __cnt
# define _base __base
# define _filbuf(fp) ((fp)->__cnt = 0, __filbuf(fp))
+# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
+#endif
+
+#ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
+extern int _filbuf(FILE*);
#endif
#endif
@@
-390,7
+400,8
@@
m_getfld (int state, unsigned char *name, unsigned char *buf,
*cp++ = j = *(iob->_ptr + c);
c = _filbuf(iob);
#endif
*cp++ = j = *(iob->_ptr + c);
c = _filbuf(iob);
#endif
- if (c == EOF || (j == '\0' || j == '\n') && c != ' ' && c != '\t') {
+ if (c == EOF ||
+ ((j == '\0' || j == '\n') && c != ' ' && c != '\t')) {
if (c != EOF) {
#ifdef LINUX_STDIO
--iob->_IO_read_ptr;
if (c != EOF) {
#ifdef LINUX_STDIO
--iob->_IO_read_ptr;
@@
-571,7
+582,7
@@
m_unknown(FILE *iob)
pat_map = (unsigned char **) calloc (256, sizeof(unsigned char *));
for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ )
pat_map = (unsigned char **) calloc (256, sizeof(unsigned char *));
for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ )
- pat_map[*cp] = (unsigned char *) cp;
+ pat_map[(unsigned char)*cp] = (unsigned char *) cp;
if (msg_style == MS_MMDF) {
/* flush extra msg hdrs */
if (msg_style == MS_MMDF) {
/* flush extra msg hdrs */
@@
-723,7
+734,8
@@
matchc(int patln, char *pat, int strln, char *str)
while (pc != *str++)
if (str > es)
return 0;
while (pc != *str++)
if (str > es)
return 0;
-
+ if (str > es+1)
+ return 0;
sp = str; pp = pat;
while (pp < ep && *sp++ == *pp)
pp++;
sp = str; pp = pat;
while (pp < ep && *sp++ == *pp)
pp++;