Hmm a 1k line buffer, and a 4k filename buffer, something seems reversed there...
Report space required for the whole %{pairs:} string.