## LDADD is included in the program-specific LDADD since we want to add
## to this list of libraries, not replace it.
##
-LDADD = sbr/libmh.a sbr/libdtimep.a
+LDADD = sbr/libmh.a ##sbr/libdtimep.a
##
## These are used to create the default mhn.defaults config file
## Internal libraries that we create as part of the build process
## but do not install
##
-noinst_LIBRARIES = sbr/libmh.a sbr/libdtimep.a mts/libmts.a
+noinst_LIBRARIES = sbr/libmh.a mts/libmts.a
##
## These are all of our header files. Right now we don't install any of
sbr/context_replace.c sbr/context_save.c \
sbr/copy.c sbr/copyip.c sbr/cpydata.c \
sbr/cpydgst.c sbr/crawl_folders.c sbr/discard.c \
- sbr/done.c sbr/dtime.c sbr/escape_addresses.c \
+ sbr/done.c sbr/dtimep.l sbr/dtime.c \
+ sbr/escape_addresses.c \
sbr/error.c sbr/ext_hook.c sbr/fdcompare.c \
sbr/folder_addmsg.c sbr/folder_delmsgs.c \
sbr/folder_free.c sbr/folder_pack.c \
-DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \
-DNMHLIBDIR='"$(libdir)"'
-sbr_libdtimep_a_SOURCES = sbr/dtimep.l
-sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) \
- $(DISABLE_SIGN_COMPARE_WARNING)
+##sbr_libdtimep_a_SOURCES = sbr/dtimep.l
+##sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) \
+## $(DISABLE_SIGN_COMPARE_WARNING)
mts_libmts_a_SOURCES = mts/smtp/smtp.c
CPPFLAGS="$nmh_saved_cppflags"])
if test "$nmh_cv_has_nosigncompare" = 'yes'; then
- DISABLE_SIGN_COMPARE_WARNING=-Wno-sign-compare
+ dnl DISABLE_SIGN_COMPARE_WARNING=-Wno-sign-compare
+ DISABLE_SIGN_COMPARE_WARNING=
fi
AC_SUBST([DISABLE_SIGN_COMPARE_WARNING])dnl
AC_CACHE_CHECK([whether compiler supports -Wno-pointer-sign], [nmh_cv_has_noptrsign],
[nmh_saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Wno-pointer-sign -Werror"
- AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no)
+dnl AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no)
+ AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=no,nmh_cv_has_noptrsign=no)
CFLAGS="$nmh_saved_cflags"])
dnl Can't use -ansi with gcc 4.5.3 on Cygwin, at least through setup
* prototypes
*/
int isfrom(char *);
-int lequal (unsigned char *, unsigned char *);
+int lequal (char *, char *);
int mfgets (FILE *, char **);
char *legal_person (char *);
struct adrx *seekadrx (char *);
int pidcheck (int);
CT parse_mime (char *);
int add_header (CT, char *, char *);
-int get_ctinfo (unsigned char *, CT, int);
+int get_ctinfo (char *, CT, int);
int params_external (CT, int);
int open7Bit (CT, char **);
void close_encoding (CT);
#define DISPO_FIELD "Content-Disposition"
#define MD5_FIELD "Content-MD5"
-#define isatom(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \
+#define isatom(c) (isascii((unsigned char) c) \
+ && !isspace ((unsigned char) c) \
+ && !iscntrl ((unsigned char) c) && (c) != '(' \
&& (c) != ')' && (c) != '<' && (c) != '>' \
&& (c) != '@' && (c) != ',' && (c) != ';' \
&& (c) != ':' && (c) != '\\' && (c) != '"' \
* Test for valid characters used in "token"
* as defined in RFC2045
*/
-#define istoken(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \
+#define istoken(c) (isascii((unsigned char) c) \
+ && !isspace ((unsigned char) c) \
+ && !iscntrl ((unsigned char) c) && (c) != '(' \
&& (c) != ')' && (c) != '<' && (c) != '>' \
&& (c) != '@' && (c) != ',' && (c) != ';' \
&& (c) != ':' && (c) != '\\' && (c) != '"' \
int seq_delsel (struct msgs *, char *, int, int);
int seq_getnum (struct msgs *, char *);
char *seq_list (struct msgs *, char *);
-int seq_nameok (unsigned char *);
+int seq_nameok (char *);
void seq_print (struct msgs *, char *);
void seq_printall (struct msgs *);
void seq_read (struct msgs *);
char *snprintb (char *, size_t, unsigned, char *);
int ssequal (char *, char *);
int stringdex (char *, char *);
-char *trimcpy (unsigned char *);
+char *trimcpy (char *);
int unputenv (char *);
int uprf (char *, char *);
int vfgets (FILE *, char **);
tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \
SKIPA(); }
#define SETMON() { cp++; \
- tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \
+ tw.tw_mon = month_map[(((unsigned char) cp[0]) + ((unsigned char) cp[1])) & 0x1f]; \
SKIPA(); }
#define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \
SKIPD(); }
tw.tw_flags |= TW_SZEXP; \
SKIPD(); }
#define SETDST() { tw.tw_flags |= TW_DST; }
-#define SKIPD() { while ( isdigit(*cp++) ) ; \
+#define SKIPD() { while ( isdigit((unsigned char) *cp++) ) ; \
--cp; }
-#define SKIPTOD() { while ( !isdigit(*cp++) ) ; \
+#define SKIPTOD() { while ( !isdigit((unsigned char) *cp++) ) ; \
--cp; }
-#define SKIPA() { while ( isalpha(*cp++) ) ; \
+#define SKIPA() { while ( isalpha((unsigned char) *cp++) ) ; \
--cp; }
-#define SKIPTOA() { while ( !isalpha(*cp++) ) ; \
+#define SKIPTOA() { while ( !isalpha((unsigned char) *cp++) ) ; \
--cp; }
-#define SKIPSP() { while ( isspace(*cp++) ) ; \
+#define SKIPSP() { while ( isspace((unsigned char) *cp++) ) ; \
--cp; }
-#define SKIPTOSP() { while ( !isspace(*cp++) ) ; \
+#define SKIPTOSP() { while ( !isspace((unsigned char) *cp++) ) ; \
--cp; }
#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
YY_BUFFER_STATE lexhandle;
- register unsigned char *cp;
+ char *cp;
static struct tws tw;
memset(&tw,0,sizeof(struct tws));
m_convert (struct msgs *mp, char *name)
{
int first, last, found, range, err;
- unsigned char *bp;
- char *cp;
+ char *bp, *cp;
/* check if user defined sequence */
err = attr (mp, cp = name);
}
if ((range = atoi (bp = cp)) == 0)
goto badlist;
- while (isdigit (*bp))
+ while (isdigit ((unsigned char) *bp))
bp++;
if (*bp)
goto badelim;
static int
m_conv (struct msgs *mp, char *str, int call)
{
- register int i;
- register unsigned char *cp, *bp;
- unsigned char buf[16];
+ int i;
+ char *cp, *bp;
+ char buf[16];
convdir = 1;
cp = bp = str;
- if (isdigit (*cp)) {
- while (isdigit (*bp))
+ if (isdigit ((unsigned char) *cp)) {
+ while (isdigit ((unsigned char) *bp))
bp++;
delimp = bp;
i = atoi (cp);
#ifdef LOCALE
/* doesn't enforce lower case */
- for (bp = buf; (isalpha(*cp) || *cp == '.')
+ for (bp = buf; (isalpha((unsigned char) *cp) || *cp == '.')
&& (bp - buf < (int) sizeof(buf) - 1); )
#else
for (bp = buf; ((*cp >= 'a' && *cp <= 'z') || *cp == '.')
static int
attr (struct msgs *mp, char *cp)
{
- register unsigned char *dp;
+ char *dp;
char *bp = NULL;
- register int i, j;
+ int i, j;
int found,
inverted = 0,
range = 0, /* no range */
convdir = 1; /* convert direction */
- for (dp = cp; *dp && isalnum(*dp); dp++)
+ for (dp = cp; *dp && isalnum((unsigned char) *dp); dp++)
continue;
if (*dp == ':') {
* seq:first (or)
* seq:last
*/
- if (isalpha (*dp)) {
+ if (isalpha ((unsigned char) *dp)) {
if (!strcmp (dp, "prev")) {
convdir = -1;
first = (mp->curmsg > 0) && (mp->curmsg <= mp->hghmsg)
}
if ((range = atoi(dp)) == 0)
return BADLST;
- while (isdigit (*dp))
+ while (isdigit ((unsigned char) *dp))
dp++;
if (*dp)
return BADLST;
* static prototypes
*/
static char *getcpy (char *);
-static void compress (char *, unsigned char *);
+static void compress (char *, char *);
static int isat (char *);
static int parse_address (void);
static int phrase (char *);
int
-lequal (unsigned char *a, unsigned char *b)
+lequal (char *a, char *b)
{
for (; *a; a++, b++)
if (*b == 0)
return FALSE;
else {
- char c1 = islower (*a) ? toupper (*a) : *a;
- char c2 = islower (*b) ? toupper (*b) : *b;
+ char c1 = islower ((unsigned char) *a) ?
+ toupper ((unsigned char) *a) : *a;
+ char c2 = islower ((unsigned char) *b) ?
+ toupper ((unsigned char) *b) : *b;
if (c1 != c2)
return FALSE;
}
struct adrx *
uucpadrx (char *addrs)
{
- register unsigned char *cp, *wp, *xp, *yp;
- register char *zp;
- register struct adrx *adrxp = &adrxs1;
+ char *cp, *wp, *xp, *yp, *zp;
+ struct adrx *adrxp = &adrxs1;
if (vp == NULL) {
vp = tp = getcpy (addrs);
return NULL;
}
- for (cp = tp; isspace (*cp); cp++)
+ for (cp = tp; isspace ((unsigned char) *cp); cp++)
continue;
if (*cp == 0) {
free (vp);
if ((wp = strchr(cp, ',')) == NULL) {
if ((wp = strchr(cp, ' ')) != NULL) {
xp = wp;
- while (isspace (*xp))
+ while (isspace ((unsigned char) *xp))
xp++;
if (*xp != 0 && isat (--xp)) {
yp = xp + 4;
- while (isspace (*yp))
+ while (isspace ((unsigned char) *yp))
yp++;
if (*yp != 0) {
if ((zp = strchr(yp, ' ')) != NULL)
static void
-compress (char *fp, unsigned char *tp)
+compress (char *fp, char *tp)
{
- register char c;
- register unsigned char *cp;
+ char c, *cp;
for (c = ' ', cp = tp; (*tp = *fp++) != 0;)
- if (isspace (*tp)) {
+ if (isspace ((unsigned char) *tp)) {
if (c != ' ')
*tp++ = c = ' ';
}
static int last_lex = LX_END;
static char *dp = NULL;
-static unsigned char *cp = NULL;
-static unsigned char *ap = NULL;
+static char *cp = NULL;
+static char *ap = NULL;
static char *pers = NULL;
static char *mbox = NULL;
static char *host = NULL;
}
break;
}
- while (isspace (*ap))
+ while (isspace ((unsigned char) *ap))
ap++;
if (cp)
sprintf (adr, "%.*s", (int)(cp - ap), ap);
{
/* buffer should be at least BUFSIZ bytes long */
int i, gotat = 0;
- register unsigned char c;
- register char *bp;
+ char c, *bp;
/* Add C to the buffer bp. After use of this macro *bp is guaranteed to be within the buffer. */
#define ADDCHR(C) do { *bp++ = (C); if ((bp - buffer) == (BUFSIZ-1)) goto my_lex_buffull; } while (0)
gotat = isat (cp);
c = *cp++;
- while (isspace (c))
+ while (isspace ((unsigned char) c))
c = *cp++;
if (c == 0) {
cp = NULL;
if (c == special[i].lx_chr)
return (last_lex = special[i].lx_val);
- if (iscntrl (c))
+ if (iscntrl ((unsigned char) c))
return (last_lex = LX_ERR);
for (;;) {
for (i = 0; special[i].lx_chr != 0; i++)
if (c == special[i].lx_chr)
goto got_atom;
- if (iscntrl (c) || isspace (c))
+ if (iscntrl ((unsigned char) c) || isspace ((unsigned char) c))
break;
ADDCHR(c);
}
/*
* static prototypes
*/
-static char *tailor_value (unsigned char *);
+static char *tailor_value (char *);
static void getuserinfo (void);
static const char *get_mtsconf_pathname(void);
static const char *get_mtsuserconf_pathname(void);
*/
static char *
-tailor_value (unsigned char *s)
+tailor_value (char *s)
{
int i, r;
char *bp;
break;
default:
- if (!isdigit (*s)) {
+ if (!isdigit ((unsigned char) *s)) {
*bp++ = QUOTE;
*bp = *s;
}
- r = *s != '0' ? 10 : 8;
- for (i = 0; isdigit (*s); s++)
- i = i * r + *s - '0';
+ r = ((unsigned char) *s) != '0' ? 10 : 8;
+ for (i = 0; isdigit ((unsigned char) *s); s++)
+ i = i * r + ((unsigned char) *s) - '0';
s--;
*bp = toascii (i);
break;
static void
getuserinfo (void)
{
- register unsigned char *cp;
- register char *np;
- register struct passwd *pw;
+ char *cp, *np;
+ struct passwd *pw;
if ((pw = getpwuid (getuid ())) == NULL
|| pw->pw_name == NULL
static void
mts_read_conf_file (FILE *fp)
{
- unsigned char *bp;
- char *cp, buffer[BUFSIZ];
+ char *bp, *cp, buffer[BUFSIZ];
struct bind *b;
while (fgets (buffer, sizeof(buffer), fp)) {
if (!(bp = strchr(buffer, ':')))
break;
*bp++ = 0;
- while (isspace (*bp))
+ while (isspace ((unsigned char) *bp))
*bp++ = 0;
for (b = binds; b->keyword; b++)
int
-seq_nameok (unsigned char *s)
+seq_nameok (char *s)
{
- unsigned char *pp;
+ char *pp;
if (s == NULL || *s == '\0') {
advise (NULL, "empty sequence name");
* First character in a sequence name must be
* an alphabetic character ...
*/
- if (!isalpha (*s)) {
+ if (!isalpha ((unsigned char) *s)) {
advise (NULL, "illegal sequence name: %s", s);
return 0;
}
* and can be followed by zero or more alphanumeric characters
*/
for (pp = s + 1; *pp; pp++)
- if (!isalnum (*pp)) {
+ if (!isalnum ((unsigned char) *pp)) {
advise (NULL, "illegal sequence name: %s", s);
return 0;
}
us2 = (const unsigned char *) s2;
if (!us1)
- us1 = "";
+ us1 = (const unsigned char *) "";
if (!us2)
- us2 = "";
+ us2 = (const unsigned char *) "";
while (tolower(*us1) == tolower(*us2++))
if (*us1++ == '\0')
char *
-trimcpy (unsigned char *cp)
+trimcpy (char *cp)
{
- unsigned char *sp;
+ char *sp;
/* skip over leading whitespace */
- while (isspace(*cp))
+ while (isspace((unsigned char) *cp))
cp++;
/* start at the end and zap trailing whitespace */
for (sp = cp + strlen(cp) - 1; sp >= cp; sp--) {
- if (isspace(*sp))
+ if (isspace((unsigned char) *sp))
*sp = '\0';
else
break;
/* replace remaining whitespace with spaces */
for (sp = cp; *sp; sp++) {
- if (isspace(*sp))
+ if (isspace((unsigned char) *sp))
*sp = ' ';
}
static char *akval (struct aka *, char *);
static int aleq (char *, char *);
-static char *scanp (unsigned char *);
+static char *scanp (char *);
static char *getp (char *);
static char *seekp (char *, char *, char **);
static int addfile (struct aka *, char *);
static char *
-scanp (unsigned char *p)
+scanp (char *p)
{
- while (isspace (*p))
+ while (isspace ((unsigned char) *p))
p++;
return p;
}
static char *
getp (char *p)
{
- register unsigned char *cp = scanp (p);
+ char *cp = scanp (p);
p = cp;
- while (!isspace (*cp) && *cp)
+ while (!isspace ((unsigned char) *cp) && *cp)
cp++;
*cp = 0;
static char *
seekp (char *p, char *c, char **a)
{
- register unsigned char *cp;
+ char *cp;
p = cp = scanp (p);
- while (!isspace (*cp) && *cp && *cp != ':' && *cp != ';')
+ while (!isspace ((unsigned char) *cp) && *cp && *cp != ':' && *cp != ';')
cp++;
*c = *cp;
*cp++ = 0;
static char *
getalias (char *addrs)
{
- register unsigned char *pp, *qp;
+ char *pp, *qp;
static char *cp = NULL;
if (cp == NULL)
return (cp = NULL);
/* Remove leading any space from the address. */
- for (pp = cp; isspace (*pp); pp++)
+ for (pp = cp; isspace ((unsigned char) *pp); pp++)
continue;
if (*pp == 0)
return (cp = NULL);
*qp++ = 0;
for (cp = qp, qp--; qp > pp; qp--)
if (*qp != 0) {
- if (isspace (*qp))
+ if (isspace ((unsigned char) *qp))
*qp = 0;
else
break;
/*
* static prototypes
*/
-static void make_comp (unsigned char **);
+static void make_comp (char **);
int
int inplace = 1, datesw = 1;
int msgnum;
char *cp, *maildir;
- unsigned char *comp = NULL;
- char *text = NULL, *folder = NULL, buf[BUFSIZ];
+ char *comp = NULL, *text = NULL, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
}
static void
-make_comp (unsigned char **ap)
+make_comp (char **ap)
{
- register unsigned char *cp;
- char buffer[BUFSIZ];
+ char *cp, buffer[BUFSIZ];
if (*ap == NULL) {
printf ("Enter component name: ");
adios (NULL, "too large component name %s", *ap);
for (cp = *ap; *cp; cp++)
- if (!isalnum (*cp) && *cp != '-')
+ if (!isalnum ((unsigned char) *cp) && *cp != '-')
adios (NULL, "invalid component name %s", *ap);
}
distout (char *drft, char *msgnam, char *backup)
{
int state;
- register unsigned char *dp;
- register char *resent;
+ char *dp, *resent;
char name[NAMESZ], buffer[BUFSIZ];
register FILE *ifp, *ofp;
m_getfld_state_t gstate = 0;
case BODY:
for (dp = buffer; *dp; dp++)
- if (!isspace (*dp)) {
+ if (!isspace ((unsigned char) *dp)) {
advise (NULL, BADTXT, "draft");
goto leave_bad;
}
void
GetFolderOrder(void)
{
- unsigned char *p, *s;
+ char *p, *s;
int priority = 1;
struct Folder *o;
if (!(p = context_find("Flist-Order")))
return;
for (;;) {
- while (isspace(*p))
+ while (isspace((unsigned char) *p))
++p;
s = p;
- while (*p && !isspace(*p))
+ while (*p && !isspace((unsigned char) *p))
++p;
if (p != s) {
/* Found one. */
BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth)
{
char *base, name[PATH_MAX];
- unsigned char *n;
+ char *n;
int nlinks;
DIR *dir;
struct dirent *dp;
/* Check to see if the name of the file is a number
* if it is, we assume it's a mail file and skip it
*/
- for (n = dp->d_name; *n && isdigit(*n); n++);
+ for (n = dp->d_name; *n && isdigit((unsigned char) *n); n++);
if (!*n)
continue;
strncpy (name, base, sizeof(name) - 2);
user_content (FILE *in, char *file, char *buf, CT *ctp)
{
int extrnal, vrsn;
- unsigned char *cp;
- char **ap;
+ char *cp, **ap;
char buffer[BUFSIZ];
struct multipart *m;
struct part **pp;
if (ci->ci_magic) {
/* check if specifies command to execute */
if (*ci->ci_magic == '|' || *ci->ci_magic == '!') {
- for (cp = ci->ci_magic + 1; isspace (*cp); cp++)
+ for (cp = ci->ci_magic + 1; isspace ((unsigned char) *cp); cp++)
continue;
if (!*cp)
adios (NULL, "empty pipe command for #%s directive", ci->ci_type);
int checklinelen = 0, linelen = 0; /* check for long lines */
int checkboundary = 0, boundaryclash = 0; /* check if clashes with multipart boundary */
int checklinespace = 0, linespace = 0; /* check if any line ends with space */
- unsigned char *cp = NULL, buffer[BUFSIZ];
+ char *cp = NULL, buffer[BUFSIZ];
struct text *t = NULL;
FILE *in = NULL;
CE ce = ct->c_cefile;
*/
if (check8bit) {
for (cp = buffer; *cp; cp++) {
- if (!isascii (*cp)) {
+ if (!isascii ((unsigned char) *cp)) {
contains8bit = 1;
check8bit = 0; /* no need to keep checking */
}
/*
* Check if line ends with a space.
*/
- if (checklinespace && (cp = buffer + strlen (buffer) - 2) > buffer && isspace (*cp)) {
+ if (checklinespace && (cp = buffer + strlen (buffer) - 2) > buffer && isspace ((unsigned char) *cp)) {
linespace = 1;
checklinespace = 0; /* no need to keep checking */
}
*/
if (checkboundary && buffer[0] == '-' && buffer[1] == '-') {
for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--)
- if (!isspace (*cp))
+ if (!isspace ((unsigned char) *cp))
break;
*++cp = '\0';
- if (!strncmp(buffer + 2, prefix, len) && isdigit(buffer[2 + len])) {
+ if (!strncmp(buffer + 2, prefix, len) && isdigit((unsigned char) buffer[2 + len])) {
boundaryclash = 1;
checkboundary = 0; /* no need to keep checking */
}
}
/* encode the digest using base64 */
- for (dp = digest, op = outbuf, cc = sizeof(digest) / sizeof(digest[0]);
+ for (dp = digest, op = (char *) outbuf,
+ cc = sizeof(digest) / sizeof(digest[0]);
cc > 0; cc -= 3, op += 4) {
unsigned long bits;
char *bp;
static char *ovtxt;
-static unsigned char *onelp;
+static char *onelp;
static char *parptr;
putcomp (struct mcomp *c1, struct mcomp *c2, int flag)
{
int count, cchdr;
- unsigned char *cp;
+ char *cp;
cchdr = 0;
lm = 0;
if (!(c1->c_flags & HDROUTPUT) && !(c1->c_flags & NOCOMPONENT)) {
if (c1->c_flags & UPPERCASE) /* uppercase component also */
for (cp = (c1->c_text ? c1->c_text : c1->c_name); *cp; cp++)
- if (islower (*cp))
- *cp = toupper (*cp);
+ if (islower ((unsigned char) *cp))
+ *cp = toupper ((unsigned char) *cp);
putstr (c1->c_text ? c1->c_text : c1->c_name, c1->c_flags);
if (flag != BODYCOMP) {
putstr (": ", c1->c_flags);
&& !(c2->c_flags & NOCOMPONENT)) {
if (c1->c_flags & UPPERCASE)
for (cp = c2->c_name; *cp; cp++)
- if (islower (*cp))
- *cp = toupper (*cp);
+ if (islower ((unsigned char) *cp))
+ *cp = toupper ((unsigned char) *cp);
putstr (c2->c_name, c1->c_flags);
putstr (": ", c1->c_flags);
if (!(c1->c_flags & SPLIT))
}
if (c1->c_flags & UPPERCASE)
for (cp = c2->c_text; *cp; cp++)
- if (islower (*cp))
- *cp = toupper (*cp);
+ if (islower ((unsigned char) *cp))
+ *cp = toupper ((unsigned char) *cp);
count = 0;
if (cchdr) {
term = 0;
if (flags & COMPRESS) {
for (spc = 1, cp = ret; *onelp; onelp++)
- if (isspace (*onelp)) {
+ if (isspace ((unsigned char) *onelp)) {
if (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) {
term = '\n';
*onelp++ = 0;
* static prototypes
*/
static CT get_content (FILE *, char *, int);
-static int get_comment (CT, unsigned char **, int);
+static int get_comment (CT, char **, int);
static int InitGeneric (CT);
static int InitText (CT);
/* Get MIME-Version field */
if (!mh_strcasecmp (hp->name, VRSN_FIELD)) {
int ucmp;
- char c;
- unsigned char *cp, *dp;
+ char c, *cp, *dp;
if (ct->c_vrsn) {
advise (NULL, "message %s has multiple %s: fields",
/* Now, cleanup this field */
cp = ct->c_vrsn;
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n'))
*dp++ = ' ';
for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
- if (!isspace (*dp))
+ if (!isspace ((unsigned char) *dp))
break;
*++dp = '\0';
if (debugsw)
}
else if (!mh_strcasecmp (hp->name, ENCODING_FIELD)) {
/* Get Content-Transfer-Encoding field */
- char c;
- unsigned char *cp, *dp;
+ char c, *cp, *dp;
struct str2init *s2i;
/*
/* get copy of this field */
ct->c_celine = cp = add (hp->value, NULL);
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
for (dp = cp; istoken (*dp); dp++)
continue;
}
else if (!mh_strcasecmp (hp->name, MD5_FIELD)) {
/* Get Content-MD5 field */
- unsigned char *cp, *dp;
- char *ep;
+ char *cp, *dp, *ep;
if (!checksw)
goto next_header;
ep = cp = add (hp->value, NULL); /* get a copy */
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n'))
*dp++ = ' ';
for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
- if (!isspace (*dp))
+ if (!isspace ((unsigned char) *dp))
break;
*++dp = '\0';
if (debugsw)
goto out;
}
- for (dp = cp; *dp && !isspace (*dp); dp++)
+ for (dp = cp; *dp && !isspace ((unsigned char) *dp); dp++)
continue;
*dp = '\0';
filename="foo". If it doesn't and value does, use value from
that. */
static char *
-incl_name_value (unsigned char *buf, char *name, char *value) {
+incl_name_value (char *buf, char *name, char *value) {
char *newbuf = buf;
/* Assume that name is non-null. */
if (! strstr (buf, name_plus_equal)) {
char *insertion;
- unsigned char *cp;
- char *prefix, *suffix;
+ char *cp, *prefix, *suffix;
/* Trim trailing space, esp. newline. */
for (cp = &buf[strlen (buf) - 1];
- cp >= buf && isspace (*cp);
+ cp >= buf && isspace ((unsigned char) *cp);
--cp) {
*cp = '\0';
}
* directives. Fills in the information of the CTinfo structure.
*/
int
-get_ctinfo (unsigned char *cp, CT ct, int magic)
+get_ctinfo (char *cp, CT ct, int magic)
{
int i;
- unsigned char *dp;
- char **ap, **ep;
+ char *dp, **ap, **ep;
char c;
CI ci;
/* store copy of Content-Type line */
cp = ct->c_ctline = add (cp, NULL);
- while (isspace (*cp)) /* trim leading spaces */
+ while (isspace ((unsigned char) *cp)) /* trim leading spaces */
cp++;
/* change newlines to spaces */
/* trim trailing spaces */
for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
- if (!isspace (*dp))
+ if (!isspace ((unsigned char) *dp))
break;
*++dp = '\0';
/* down case the content type string */
for (dp = ci->ci_type; *dp; dp++)
- if (isalpha(*dp) && isupper (*dp))
- *dp = tolower (*dp);
+ if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
+ *dp = tolower ((unsigned char) *dp);
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
}
cp++;
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
/* down case the content subtype string */
for (dp = ci->ci_subtype; *dp; dp++)
- if (isalpha(*dp) && isupper (*dp))
- *dp = tolower (*dp);
+ if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
+ *dp = tolower ((unsigned char) *dp);
magic_skip:
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
*/
ep = (ap = ci->ci_attrs) + NPARMS;
while (*cp == ';') {
- char *vp;
- unsigned char *up;
+ char *vp, *up;
if (ap >= ep) {
advise (NULL,
}
cp++;
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
}
/* down case the attribute name */
- for (dp = cp; istoken (*dp); dp++)
- if (isalpha(*dp) && isupper (*dp))
- *dp = tolower (*dp);
+ for (dp = cp; istoken ((unsigned char) *dp); dp++)
+ if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
+ *dp = tolower ((unsigned char) *dp);
- for (up = dp; isspace (*dp);)
+ for (up = dp; isspace ((unsigned char) *dp);)
dp++;
if (dp == cp || *dp != '=') {
advise (NULL,
vp = (*ap = add (cp, NULL)) + (up - cp);
*vp = '\0';
- for (dp++; isspace (*dp);)
+ for (dp++; isspace ((unsigned char) *dp);)
dp++;
/* now add the attribute value */
}
ap++;
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
*dp++ = c;
cp = dp;
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
}
*dp++ = c;
cp = dp;
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
}
*dp++ = c;
cp = dp;
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
}
static int
-get_comment (CT ct, unsigned char **ap, int istype)
+get_comment (CT ct, char **ap, int istype)
{
int i;
- char *bp;
- unsigned char *cp;
+ char *bp, *cp;
char c, buffer[BUFSIZ], *dp;
CI ci;
}
}
- while (isspace (*cp))
+ while (isspace ((unsigned char) *cp))
cp++;
*ap = cp;
{
int inout;
long last, pos;
- unsigned char *cp, *dp;
- char **ap, **ep;
+ char *cp, *dp, **ap, **ep;
char *bp, buffer[BUFSIZ];
struct multipart *m;
struct k2v *kv;
char *cte = add (ct->c_celine ? ct->c_celine : "(null)", NULL);
bp = cte + strlen (cte) - 1;
- while (bp >= cte && isspace (*bp)) *bp-- = '\0';
- for (bp = cte; *bp && isblank (*bp); ++bp) continue;
+ while (bp >= cte && isspace ((unsigned char) *bp)) *bp-- = '\0';
+ for (bp = cte; *bp && isblank ((unsigned char) *bp); ++bp) continue;
admonish (NULL,
"\"%s/%s\" type in message %s must be encoded in\n"
ct->c_ctparams = (void *) m;
/* check if boundary parameter contains only whitespace characters */
- for (cp = bp; isspace (*cp); cp++)
+ for (cp = bp; isspace ((unsigned char) *cp); cp++)
continue;
if (!*cp) {
advise (NULL, "invalid \"boundary\" parameter for \"%s/%s\" type in message %s's %s: field",
/* remove trailing whitespace from boundary parameter */
for (cp = bp, dp = cp + strlen (cp) - 1; dp > cp; dp--)
- if (!isspace (*dp))
+ if (!isspace ((unsigned char) *dp))
break;
*++dp = '\0';
int fd, len, skip, own_ct_fp = 0;
uint32_t bits;
unsigned char value, b;
- unsigned char *cp, *ep;
- char buffer[BUFSIZ];
+ char *cp, *ep, buffer[BUFSIZ];
/* sbeck -- handle suffixes */
CI ci;
CE ce;
for (ep = (cp = buffer) + cc; cp < ep; cp++) {
switch (*cp) {
default:
- if (isspace (*cp))
+ if (isspace ((unsigned char) *cp))
break;
- if (skip || (*cp & 0x80)
- || (value = b642nib[*cp & 0x7f]) > 0x3f) {
+ if (skip || (((unsigned char) *cp) & 0x80)
+ || (value = b642nib[((unsigned char) *cp) & 0x7f]) > 0x3f) {
if (debugsw) {
fprintf (stderr, "*cp=0x%x pos=%ld skip=%d\n",
- *cp,
+ (unsigned char) *cp,
(long) (lseek (fd, (off_t) 0, SEEK_CUR) - (ep - cp)),
skip);
}
openQuoted (CT ct, char **file)
{
int cc, digested, len, quoted, own_ct_fp = 0;
- unsigned char *cp, *ep;
+ char *cp, *ep;
char buffer[BUFSIZ];
unsigned char mask;
CE ce;
len -= cc;
for (ep = (cp = buffer) + cc - 1; cp <= ep; ep--)
- if (!isspace (*ep))
+ if (!isspace ((unsigned char) *ep))
break;
*++ep = '\n', ep++;
/* in an escape sequence */
if (quoted == 1) {
/* at byte 1 of an escape sequence */
- mask = hex2nib[*cp & 0x7f];
+ mask = hex2nib[((unsigned char) *cp) & 0x7f];
/* next is byte 2 */
quoted = 2;
} else {
/* at byte 2 of an escape sequence */
mask <<= 4;
- mask |= hex2nib[*cp & 0x7f];
+ mask |= hex2nib[((unsigned char) *cp) & 0x7f];
putc (mask, ce->ce_fp);
if (digested)
MD5Update (&mdContext, &mask, 1);
if (cp + 1 >= ep || cp + 2 >= ep) {
/* We don't have 2 bytes left, so this is an invalid
* escape sequence; just show the raw bytes (below). */
- } else if (isxdigit (cp[1]) && isxdigit (cp[2])) {
+ } else if (isxdigit ((unsigned char) cp[1]) &&
+ isxdigit ((unsigned char) cp[2])) {
/* Next 2 bytes are hex digits, making this a valid escape
* sequence; let's decode it (above). */
quoted = 1;
parse (char *buffer, struct Cmd *cmdp)
{
int argp = 0;
- unsigned char c, *cp;
- char *pp;
+ char c, *cp, *pp;
cmdp->line[0] = 0;
pp = cmdp->args[argp++] = cmdp->line;
cmdp->stream = NULL;
for (cp = buffer; (c = *cp); cp++) {
- if (!isspace (c))
+ if (!isspace ((unsigned char) c))
break;
}
if (c == '\0') {
}
while ((c = *cp++)) {
- if (isspace (c)) {
- while (isspace (c))
+ if (isspace ((unsigned char) c)) {
+ while (isspace ((unsigned char) c))
c = *cp++;
if (c == 0)
break;
}
cmdp->redirect = pp + 1;/* sigh */
for (; (c = *cp); cp++)
- if (!isspace (c))
+ if (!isspace ((unsigned char) c))
break;
if (c == 0) {
padvise (NULL, cmdp->direction != PIPIO
strcpy (cmdp->redirect, cp);
if (cmdp->direction != PIPIO) {
for (; *cp; cp++)
- if (isspace (*cp)) {
+ if (isspace ((unsigned char) *cp)) {
padvise (NULL, "bad name for redirect");
return NOTOK;
}
pINI (void)
{
int i, vrsn;
- unsigned char *bp;
+ char *bp;
struct record rcs, *rc;
rc = &rcs;
switch (peer2rc (rc)) {
case RC_INI:
bp = rc->rc_data;
- while (isspace (*bp))
+ while (isspace ((unsigned char) *bp))
bp++;
if (sscanf (bp, "%d", &vrsn) != 1) {
bad_init: ;
done (1);
}
- while (*bp && !isspace (*bp))
+ while (*bp && !isspace ((unsigned char) *bp))
bp++;
- while (isspace (*bp))
+ while (isspace ((unsigned char) *bp))
bp++;
if (sscanf (bp, "%d", &numwins) != 1 || numwins <= 0)
goto bad_init;
numwins = NWIN;
for (i = 1; i <= numwins; i++) {
- while (*bp && !isspace (*bp))
+ while (*bp && !isspace ((unsigned char) *bp))
bp++;
- while (isspace (*bp))
+ while (isspace ((unsigned char) *bp))
bp++;
if (sscanf (bp, "%d", &windows[i]) != 1 || windows[i] <= 0)
goto bad_init;
is_nontext (int msgnum)
{
int result, state;
- unsigned char *bp, *dp;
- char *cp;
+ char *bp, *dp, *cp;
char buf[BUFSIZ], name[NAMESZ];
FILE *fp;
passno = 1;
again:
- for (; isspace (*bp); bp++)
+ for (; isspace ((unsigned char) *bp); bp++)
continue;
if (*bp == '(') {
int i;
if ((result = (mh_strcasecmp (bp, "plain") != 0)))
goto out;
*dp = c;
- for (dp++; isspace (*dp); dp++)
+ for (dp++; isspace ((unsigned char) *dp); dp++)
continue;
if (*dp) {
if ((result = !uprf (dp, "charset")))
goto out;
dp += sizeof "charset" - 1;
- while (isspace (*dp))
+ while (isspace ((unsigned char) *dp))
dp++;
if (*dp++ != '=')
goto invalid;
- while (isspace (*dp))
+ while (isspace ((unsigned char) *dp))
dp++;
if (*dp == '"') {
if ((bp = strchr(++dp, '"')))
*bp = '\0';
} else {
for (bp = dp; *bp; bp++)
- if (isspace (*bp)) {
+ if (isspace ((unsigned char) *bp)) {
*bp = '\0';
break;
}
state = m_getfld (&gstate, name, buf, &bufsz, fp);
cp = add (buf, cp);
}
- for (bp = cp; isspace (*bp); bp++)
+ for (bp = cp; isspace ((unsigned char) *bp); bp++)
continue;
for (dp = bp; istoken (*dp); dp++)
continue;
int cclcnt;
register unsigned char *ep, *dp, *sp, *lastep = 0;
- dp = (ep = n->n_expbuf) + sizeof n->n_expbuf;
- sp = astr;
+ dp = (ep = (unsigned char *) n->n_expbuf) + sizeof n->n_expbuf;
+ sp = (unsigned char *) astr;
if (*sp == '^') {
n->n_circf = 1;
sp++;
star:
do {
lp--;
- if (advance (lp, ep))
+ if (advance ((char *) lp, (char *) ep))
return (1);
} while (lp > curlp);
return 0;
static void pl (void);
static void anno (void);
static int annoaux (struct mailname *);
-static void insert_fcc (struct headers *, unsigned char *);
+static void insert_fcc (struct headers *, char *);
static void make_bcc_file (int);
static void verify_all_addresses (int, char *);
static void chkadr (void);
static void
start_headers (void)
{
- unsigned char *cp;
- char sigbuf[BUFSIZ];
+ char *cp, sigbuf[BUFSIZ];
struct mailname *mp;
time (&tclock);
static void
-insert_fcc (struct headers *hdr, unsigned char *pp)
+insert_fcc (struct headers *hdr, char *pp)
{
- unsigned char *cp;
+ char *cp;
- for (cp = pp; isspace (*cp); cp++)
+ for (cp = pp; isspace ((unsigned char) *cp); cp++)
continue;
- for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--)
+ for (pp += strlen (pp) - 1; pp > cp && isspace ((unsigned char) *pp); pp--)
continue;
if (pp >= cp)
*++pp = 0;
find_prefix (void)
{
int result = OK;
- unsigned char buffer[BUFSIZ];
+ char buffer[BUFSIZ];
FILE *in;
if ((in = fopen (tmpfil, "r")) == NULL)
while (fgets (buffer, sizeof(buffer) - 1, in))
if (buffer[0] == '-' && buffer[1] == '-') {
- unsigned char *cp;
+ char *cp;
for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--)
- if (!isspace (*cp))
+ if (!isspace ((unsigned char) *cp))
break;
*++cp = '\0';
if (strcmp (buffer + 2, prefix) == 0) {
struct format *fmt;
register char **ap;
int char_read = 0, format_len, mask;
- char name[NAMESZ], *scanl;
- unsigned char *cp;
+ char name[NAMESZ], *scanl, *cp;
static int dat[5]; /* aux. data for format routine */
m_getfld_state_t gstate = 0;
register char *sp = cp;
for (;;) {
- while (isspace(*cp))
+ while (isspace((unsigned char) *cp))
cp++;
if(uprf(cp, "re:"))
cp += 3;
int unseen, char *folder, long size, int noisy)
{
int i, compnum, encrypted, state;
- unsigned char *cp, *tmpbuf, *startbody;
- char **nxtbuf;
+ char *cp, *tmpbuf, *startbody, **nxtbuf;
char *saved_c_text = NULL;
struct comp *cptr;
struct comp **savecomp;
cptr->c_text = tmpbuf;
for (cp = tmpbuf + strlen (tmpbuf) - 1;
cp >= tmpbuf; cp--)
- if (isspace (*cp))
+ if (isspace ((unsigned char) *cp))
*cp = 0;
else
break;
is_nontext (char *msgnam)
{
int result, state;
- unsigned char *bp, *dp;
- char *cp;
+ char *bp, *dp, *cp;
char buf[BUFSIZ], name[NAMESZ];
FILE *fp;
m_getfld_state_t gstate = 0;
passno = 1;
again:
- for (; isspace (*bp); bp++)
+ for (; isspace ((unsigned char) *bp); bp++)
continue;
if (*bp == '(') {
int i;
if ((result = (mh_strcasecmp (bp, "plain") != 0)))
goto out;
*dp = c;
- for (dp++; isspace (*dp); dp++)
+ for (dp++; isspace ((unsigned char) *dp); dp++)
continue;
if (*dp) {
if ((result = !uprf (dp, "charset")))
goto out;
dp += sizeof("charset") - 1;
- while (isspace (*dp))
+ while (isspace ((unsigned char) *dp))
dp++;
if (*dp++ != '=')
goto invalid;
- while (isspace (*dp))
+ while (isspace ((unsigned char) *dp))
dp++;
if (*dp == '"') {
if ((bp = strchr(++dp, '"')))
state = m_getfld (&gstate, name, buf, &bufsz, fp);
cp = add (buf, cp);
}
- for (bp = cp; isspace (*bp); bp++)
+ for (bp = cp; isspace ((unsigned char) *bp); bp++)
continue;
- for (dp = bp; istoken (*dp); dp++)
+ for (dp = bp; istoken ((unsigned char) *dp); dp++)
continue;
*dp = '\0';
result = (mh_strcasecmp (bp, "7bit")
split (char *cp, char **vec)
{
int i;
- unsigned char *s;
+ char *s;
s = cp;
vec[i] = NULL;
/* zap any whitespace and comma's */
- while (isspace (*s) || *s == ',')
+ while (isspace ((unsigned char) *s) || *s == ',')
*s++ = 0;
/* end of buffer, time to leave */
vec[i++] = s++;
/* move forward to next field delimiter */
- while (*s && !isspace (*s) && *s != ',')
+ while (*s && !isspace ((unsigned char) *s) && *s != ',')
s++;
}
vec[i] = NULL;
get_sender (char *envelope, char **sender)
{
int i;
- unsigned char *cp;
- unsigned char buffer[BUFSIZ];
+ char *cp;
+ char buffer[BUFSIZ];
if (envelope == NULL) {
*sender = getcpy ("");
*cp = 0;
for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--)
- if (isspace (*cp))
+ if (isspace ((unsigned char) *cp))
*cp = 0;
else
break;
trim (char *cp)
{
char buffer[BUFSIZ*4];
- unsigned char *bp, *sp;
+ char *bp, *sp;
if (cp == NULL)
return NULL;
bp = buffer;
/* skip over leading whitespace */
- while (isspace(*bp))
+ while (isspace((unsigned char) *bp))
bp++;
/* start at the end and zap trailing whitespace */
for (sp = bp + strlen(bp) - 1; sp >= bp; sp--) {
- if (isspace(*sp))
+ if (isspace((unsigned char) *sp))
*sp = 0;
else
break;
/* replace remaining whitespace with spaces */
for (sp = bp; *sp; sp++)
- if (isspace(*sp))
+ if (isspace((unsigned char) *sp))
*sp = ' ';
/* now return a copy */
}
for (compnum = 1;;) {
int bufsz = sizeof buf;
- switch (state = m_getfld (&gstate, (unsigned char *) nam,
- (unsigned char *) buf, &bufsz, in)) {
+ switch (state = m_getfld (&gstate, nam, buf, &bufsz, in)) {
case FLD:
case FLDPLUS:
compnum++;
datecomp = add (buf, datecomp);
while (state == FLDPLUS) {
bufsz = sizeof buf;
- state = m_getfld (&gstate, (unsigned char *) nam,
- (unsigned char *) buf, &bufsz, in);
+ state = m_getfld (&gstate, nam, buf, &bufsz, in);
datecomp = add (buf, datecomp);
}
if (!subjsort || subjcomp)
subjcomp = add (buf, subjcomp);
while (state == FLDPLUS) {
bufsz = sizeof buf;
- state = m_getfld (&gstate, (unsigned char *) nam,
- (unsigned char *) buf, &bufsz, in);
+ state = m_getfld (&gstate, nam, buf, &bufsz, in);
subjcomp = add (buf, subjcomp);
}
if (datecomp)
/* just flush this guy */
while (state == FLDPLUS) {
bufsz = sizeof buf;
- state = m_getfld (&gstate, (unsigned char *) nam,
- (unsigned char *) buf, &bufsz, in);
+ state = m_getfld (&gstate, nam, buf, &bufsz, in);
}
}
continue;