- for (state = FLD;;) {
- switch (state = m_getfld(state, name, field, sizeof(field),
- fp)) {
- case FLD:
- case FLDPLUS:
- case FLDEOF:
- if (state == FLDPLUS) {
- cp = getcpy(field);
- while (state == FLDPLUS) {
- state = m_getfld(state, name, field,
- sizeof(field), fp);
- cp = add(field, cp);
- }
- seq_init(mp, getcpy(name), trimcpy(cp));
- free(cp);
- } else {
- seq_init(mp, getcpy(name), trimcpy(field));
- }
- if (state == FLDEOF)
- break;
+ for (state = FLD2;;) {
+ switch (state = m_getfld2(state, &f, fp)) {
+ case LENERR2:
+ state = FLD2;
+ /* FALL */
+ case FLD2:
+ seq_init(mp, mh_xstrdup(f.name), trimcpy(f.value));