Ticket #1718: OpenSuse: Showing 'B' artefact in command line of user 'root'

This patch was grabbed from Russian fork (ru-fork). Original commit message:

[COMMAND LINE]:  Fix SUSE gabage, letter B in command prompt under root!  Yessssssss! :)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
pavlinux 2009-10-26 17:27:46 +02:00 committed by Slava Zanko
parent 467d833ac3
commit ad8e1563d4

View File

@ -780,7 +780,8 @@ strip_ctrl_codes (char *s)
for (w = s, r = s; *r; ) {
if (*r == ESC_CHAR) {
/* Skip the control sequence's arguments */ ;
if (*(++r) == '[') {
/* '(' need to avoid strange 'B' letter in *Suse (if mc runs under root user) */
if (*(++r) == '[' || *r == '(') {
/* strchr() matches trailing binary 0 */
while (*(++r) && strchr ("0123456789;?", *r));
} else