top: VIS_SAFE turned out to be unsafe

Unset VIS_SAFE flag as it turned out to be actually unsafe
for continuos top display as it's passing through sequences
resulting cursor movement (backspace, tab, carriage-return),
and explicitly set VIS_TAB for the same reason.

Reported by:	Mark Millard <marklmi@yahoo.com>, swills
Tested by:	Mark Millard <marklmi@yahoo.com>, swills
This commit is contained in:
yuripv 2020-07-14 22:43:40 +00:00
parent 4863432c83
commit 2401429048

View File

@ -1016,7 +1016,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags
len = (argbuflen - (dst - argbuf) - 1) / 4; len = (argbuflen - (dst - argbuf) - 1) / 4;
strvisx(dst, src, strvisx(dst, src,
MIN(strlen(src), len), MIN(strlen(src), len),
VIS_NL | VIS_CSTYLE | VIS_OCTAL | VIS_SAFE); VIS_NL | VIS_TAB | VIS_CSTYLE | VIS_OCTAL);
while (*dst != '\0') while (*dst != '\0')
dst++; dst++;
if ((argbuflen - (dst - argbuf) - 1) / 4 > 0) if ((argbuflen - (dst - argbuf) - 1) / 4 > 0)