]> diplodocus.org Git - nmh/commit
cpstripped(): Rewrite multi-byte version.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 6 Aug 2017 17:15:41 +0000 (18:15 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 6 Aug 2017 17:15:41 +0000 (18:15 +0100)
commita091c28b416f83aa46dcb0bd0da81ca1d3b8a7f9
tree295589328f6ce872aa353ac69c55e878bc50ee35
parent8ba2c2e0a5c0e2c087cd1684a885b959c101e010
cpstripped(): Rewrite multi-byte version.

Removes the assert(3) failure reported on the list for 1.7-RC1 when a
non-space, non-cntrl, rune has a wcwidth(3) of -1; output L'?' in its
place.  The old code also didn't reset mbtowc(3)'s state before trying
to parse "?";  that's handled differently now so isn't an issue.  Pad
with the multi-byte encoding of L" ", having ensured the wcwidth(1) of
L' ' is one, rather than with a non-wchar_t ' '.  Point out padding only
occurs in one particular case, and not the other two;  quite odd.
sbr/fmt_scan.c