telepathy-idle: ctcp: Don't bling the non-bling
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Oct 31 23:12:17 UTC 2020
Module: telepathy-idle
Branch: master
Commit: bf6d596e40e5b9426a68dcd22aa62a697457c4f7
URL: http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=bf6d596e40e5b9426a68dcd22aa62a697457c4f7
Author: Florian Müllner <fmuellner at gnome.org>
Date: Sat Feb 13 10:08:42 2016 +0100
ctcp: Don't bling the non-bling
When stripping color codes, we currently remove any sequence of digits
following ^C. As color codes use at most two digits, this means that we
also remove any numbers at the start of the colored text - make sure we
stop doing that and only remove digits that are actually part of a color
code.
https://bugs.freedesktop.org/show_bug.cgi?id=94189
---
src/idle-ctcp.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/idle-ctcp.c b/src/idle-ctcp.c
index f282360..f28bf4b 100644
--- a/src/idle-ctcp.c
+++ b/src/idle-ctcp.c
@@ -98,13 +98,18 @@ gchar *idle_ctcp_kill_blingbling(const gchar *msg) {
case '\x03': /* ^C */
iter++;
- while (isdigit(*iter))
+ /* Color codes are 1-2 digits */
+ if (isdigit(*iter))
+ iter++;
+ if (isdigit(*iter))
iter++;
if (*iter == ',') {
iter++;
- while (isdigit(*iter))
+ if (isdigit(*iter))
+ iter++;
+ if (isdigit(*iter))
iter++;
}
break;
More information about the telepathy-commits
mailing list