changeset 643:df1ceace5cac

[gaim-migrate @ 653] this should take care of hideous backgrounds in toc's user info committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 08 Aug 2000 22:47:47 +0000
parents a79bbed31f7e
children b3900e312d8e
files src/gtkhtml.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkhtml.c	Tue Aug 08 21:08:56 2000 +0000
+++ b/src/gtkhtml.c	Tue Aug 08 22:47:47 2000 +0000
@@ -3421,12 +3421,19 @@
 						(tag, "BODY BGCOLOR", strlen("BODY BGCOLOR")))
 				{
 
+					char *d = tag;
 					/*
 					 * Ditch trailing \" 
 					 */
 					current = push_state(current);
-					tag[strlen(tag) - 1] = 0;
-					if (sscanf(tag + strlen("BODY BGCOLOR=\"#"), "%x", &colorv)
+					d += strlen("BODY BGCOLOR=");
+					if (*d == '\"')
+						d++;
+					if (*d == '#')
+						d++;
+					if (d[strlen(d) - 1] == '\"')
+						d[strlen(d) - 1] = 0;
+					if (sscanf(d, "%x", &colorv)
 						&& !(options & HTML_OPTION_NO_COLOURS))
 					{
 						current->bgcol = get_color(colorv, map);