af160e1613
Replace string duplication with a buffer that grows as needed and reuses the existing buffer in nested functions.