--- nmh-1.3/sbr/m_getfld.c.~1~ 2008-04-05 11:41:37.000000000 -0700 +++ nmh-1.3/sbr/m_getfld.c 2008-11-28 10:25:34.768265994 -0800 @@ -731,18 +731,18 @@ matchc(int patln, char *pat, int strln, register char *ep = pat + patln; register char pc = *pat++; - for(;;) { - while (pc != *str++) - if (str > es) - return 0; + for(;str <= es; str++) { + if (pc != *str) + continue; if (str > es+1) return 0; - sp = str; pp = pat; + sp = str+1; pp = pat; while (pp < ep && *sp++ == *pp) pp++; if (pp >= ep) - return ((unsigned char *)--str); + return ((unsigned char *)str); } + return 0; }