top: correct an insidious occasional truncation buglet

With the help of our Swedish translator, hopefully the
final buglet has now been vanquished in the multi-byte
translation support. This one was a real nasty bugger.

Although it didn't occur with every terminal emulator,
occasionally random text lines were being chopped off.

As it turns out, those terminals were blameless. There
were two separate places in top's show_special routine
where potential multi-byte sequences were inadequately
addressed. Solution: exploit existing utf-8 functions.

[ it also became apparent that the translation hints ]
[ in the top_nls module were deficient. so a special ]
[ caution was added regarding the final line of txt. ]

Reference(s):
https://gitlab.com/procps-ng/procps/issues/68

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2017-10-01 23:59:59 -05:00
committed by Craig Small
parent d5a9965cde
commit f6ee2c0085
3 changed files with 16 additions and 2 deletions

View File

@@ -86,6 +86,9 @@
/* For the impetus and NUMA/Node prototype design, thanks to:
Lance Shelton <LShelton@fusionio.com> - April, 2013 */
/* For prompting & helping with top's utf-8 support, thanks to:
Göran Uddeborg <goeran@uddeborg.se> - September, 2017 */
#ifdef PRETEND2_5_X
#define linux_version_code LINUX_VERSION(2,5,43)
#endif