strip_colour: Strip '\x11' (monospace) and '\x1e' (strikethrough)

Also clarify the comment: this function strips more than just colours.
This commit is contained in:
Tobias Geerinckx-Rice 2022-12-04 01:00:00 +01:00 committed by Doug Freed
parent 8e3239be2e
commit 32d37a1660

View file

@ -24,7 +24,7 @@
#define __INLINE_STRINGOPS_H #define __INLINE_STRINGOPS_H
/* /*
* strip_colour - remove colour codes from a string * strip_colour - remove colour and formatting codes from a string
* -asuffield (?) * -asuffield (?)
*/ */
static inline char * static inline char *
@ -57,10 +57,12 @@ strip_colour(char *string)
case 6: case 6:
case 7: case 7:
case 15: case 15:
case 17:
case 22: case 22:
case 23: case 23:
case 27: case 27:
case 29: case 29:
case 30:
case 31: case 31:
break; break;
case 32: case 32: