void padios (char *, char *, ...);
void padvise (char *, char *, ...);
+extern m_getfld_state_t gstate; /* use the gstate in scansbr.c */
+
/*
* static prototypes
display_info (id > 0 ? scansw : 0);
msh (id > 0 ? scansw : 0);
+ scan_finished ();
m_reset ();
mp->msgattrs[0] = getcpy ("unseen");
mp->msgattrs[1] = NULL;
- m_unknown (fp); /* the MAGIC invocation */
+ scan_detect_mbox_style (fp); /* the MAGIC invocation */
if (fmsh) {
free (fmsh);
fmsh = NULL;
return yp;
}
- m_eomsbr ((int (*)()) 0); /* XXX */
+ scan_reset_m_getfld_state ();
+ scan_eom_action ((int (*)()) 0); /* XXX */
fseek (fp, Msgs[msgnum].m_start, SEEK_SET);
return fp;
}
return Msgs[msgnum].m_bboard_id;
zp = msh_ready (msgnum, 0);
- for (state = FLD;;)
- switch (state = m_getfld (state, name, buf, sizeof(buf), zp)) {
+ for (;;) {
+ int bufsz = sizeof buf;
+ switch (state = m_getfld (&gstate, name, buf, &bufsz, zp)) {
case FLD:
- case FLDEOF:
case FLDPLUS:
if (!mh_strcasecmp (name, BBoard_ID)) {
bp = getcpy (buf);
while (state == FLDPLUS) {
- state = m_getfld (state, name, buf, sizeof(buf), zp);
+ bufsz = sizeof buf;
+ state = m_getfld (&gstate, name, buf, &bufsz, zp);
bp = add (buf, bp);
}
i = atoi (bp);
else
continue;
}
- while (state == FLDPLUS)
- state = m_getfld (state, name, buf, sizeof(buf), zp);
- if (state != FLDEOF)
- continue;
+ while (state == FLDPLUS) {
+ bufsz = sizeof buf;
+ state = m_getfld (&gstate, name, buf, &bufsz, zp);
+ }
+ continue;
default:
return 0;
}
+ }
}
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;