Fix uip/whom.c for C89 compatibility
[mmh] / uip / slocal.c
index f8f9d95..df0dc7f 100644 (file)
@@ -72,6 +72,7 @@ static struct swit switches[] = {
        { NULL, 0 }
 };
 
+char *version=VERSION;
 
 static int globbed = 0;  /* have we built "vars" table yet? */
 static int parsed = 0;  /* have we built header field table yet */
@@ -758,10 +759,14 @@ parse(int fd)
        */
        for (i = 0, state = FLD2;;) {
                switch (state = m_getfld2(state, &f, in)) {
+               case LENERR2:
+                       state = FLD2;
+                       /* FALL */
+
                case FLD2:
                        lp = mh_xstrdup(f.value);
                        for (p = hdrs; p->p_name; p++) {
-                               if (mh_strcasecmp(p->p_name, f.name)!=0) {
+                               if (mh_strcasecmp(p->p_name, f.name) == 0) {
                                        if (!(p->p_flags & P_HID)) {
                                                if ((cp = p->p_value)) {
                                                        if (p->p_flags & P_ADR) {
@@ -793,7 +798,6 @@ parse(int fd)
                case FILEEOF2:
                        break;
 
-               case LENERR2:
                case FMTERR2:
                case IOERR2:
                        advise(NULL, "format error in message");