X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/df6971a59e8d01dcfe605bbac949b7d4b3ab0a92..76ddfab4d76264b1cb30d7df642965c141e61545:/uip/mhcachesbr.c?ds=inline diff --git a/uip/mhcachesbr.c b/uip/mhcachesbr.c index 2c188653..25ac9ab0 100644 --- a/uip/mhcachesbr.c +++ b/uip/mhcachesbr.c @@ -108,14 +108,6 @@ cache_content (CT ct) return; } -/* THIS NEEDS TO BE FIXED */ -#if 0 - if (ct->c_ceopenfnx == openMail) { - advise (NULL, "a radish may no know Greek, but I do..."); - return; - } -#endif - if (find_cache (NULL, wcachesw != CACHE_NEVER ? wcachesw : CACHE_ASK, &cachetype, ct->c_id, cachefile, sizeof(cachefile)) == NOTOK) { @@ -384,25 +376,27 @@ find_cache_aux2 (char *mapfile, char *id, char *mapname, int namelen) int state; char buf[BUFSIZ], name[NAMESZ]; FILE *fp; + m_getfld_state_t gstate = 0; if (!(fp = lkfopen (mapfile, "r"))) return NOTOK; - for (state = FLD;;) { + for (;;) { int result; char *cp, *dp; + int bufsz = sizeof buf; - switch (state = m_getfld (state, name, buf, sizeof(buf), fp)) { + switch (state = m_getfld (&gstate, name, buf, &bufsz, fp)) { case FLD: case FLDPLUS: - case FLDEOF: strncpy (mapname, name, namelen); if (state != FLDPLUS) cp = buf; else { cp = add (buf, NULL); while (state == FLDPLUS) { - state = m_getfld (state, name, buf, sizeof(buf), fp); + bufsz = sizeof buf; + state = m_getfld (&gstate, name, buf, &bufsz, fp); cp = add (buf, cp); } } @@ -418,18 +412,16 @@ find_cache_aux2 (char *mapfile, char *id, char *mapname, int namelen) lkfclose (fp, mapfile); return OK; } - if (state != FLDEOF) - continue; - /* else fall... */ + continue; case BODY: - case BODYEOF: case FILEEOF: default: break; } break; } + m_getfld_state_destroy (&gstate); lkfclose (fp, mapfile); return NOTOK;