So the per-line code becomes:
```
const char *m_pos = buf;
while (NULL != (m_pos = strstr(m_pos, "-M")))
{
    if ((m_pos == buf || isspace(m_pos[-1])) &&
        (isspace(m_pos[2]) || ispunct(m_pos[2])))
    {
        supports_capital_m = SUPPORTS _CAPITAL_M_YES;
        break; /* out of the strstr loop; but read to end of input to avoid broken pipe */
     }
     else
     {
         m_pos++; /* so next strstr finds a later match, if any */
     }
}
```