# HG changeset patch # User Eric Warmenhoven # Date 990651764 0 # Node ID 060161a5d5f812aaffbc5e9c66e4b2e6f71a9db8 # Parent 922d8505ae5afaac73c710353b1e0f4f9b98973b [gaim-migrate @ 1893] David Stoddard's strip_html patch. temas, don't use this. committer: Tailor Script diff -r 922d8505ae5a -r 060161a5d5f8 src/html.c --- a/src/html.c Wed May 23 11:39:05 2001 +0000 +++ b/src/html.c Wed May 23 21:02:44 2001 +0000 @@ -41,16 +41,25 @@ gchar *strip_html(gchar *text) { - int i, j; + int i, j, k; int visible = 1; - gchar *text2 = g_malloc(strlen(text) + 1); + gchar *text2 = g_strdup(text); - strcpy(text2, text); for (i = 0, j = 0; text2[i]; i++) { if (text2[i] == '<') { - visible = 0; - continue; - } else if (text2[i] == '>') { + k = i + 1; + while (text2[k]) { + if (text2[k] == '<') { + visible = 1; + break; + } + if (text2[k] == '>') { + visible = 0; + break; + } + k++; + } + } else if (text2[i] == '>' && !visible) { visible = 1; continue; }