fix function formatting
Refactor buflist_findpat "two-iteration loop" anti-pattern
Another occurence of Issue #572.