Update printf implementation to do the same as echo -e for the %b format specifier: expand backslash escape sequences in the provided argument but not % format specifiers.
Extracts inner logic from Format into formatIntoBuffer to avoid issues with non-reentrancy of Format (due to use of a special cached buffer in Config.
Request for feedback
This was the simplest change that I could see, but I wasn't thrilled about having formatIntoBuffer recursively call itself for the %b case; this shouldn't generally be problematic, since the recursive call won't process % format specifiers and shouldn't further recur.
Update
printf
implementation to do the same asecho -e
for the%b
format specifier: expand backslash escape sequences in the provided argument but not%
format specifiers.Extracts inner logic from
Format
intoformatIntoBuffer
to avoid issues with non-reentrancy ofFormat
(due to use of a special cached buffer inConfig
.Request for feedback
This was the simplest change that I could see, but I wasn't thrilled about having
formatIntoBuffer
recursively call itself for the%b
case; this shouldn't generally be problematic, since the recursive call won't process%
format specifiers and shouldn't further recur.