diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-24 00:12:24 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-24 00:12:24 +0100 |
commit | be999a5385ff4e9ac7416de4cca3288f18cee85c (patch) | |
tree | ddd6a6e256719c378e9748e0d96791e11844f659 /lib/misc.c | |
parent | 237eadd361a7ed1d2a49180056d12b57f6f3cc0a (diff) | |
parent | eb6df6a280c458546ebc57126e63a828674b4cd8 (diff) |
First step in this merge. Mostly a bzr merge and then a cleanup of conflicts
and parts I want to/have to redo (because of ui-fix).
Diffstat (limited to 'lib/misc.c')
-rw-r--r-- | lib/misc.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -156,6 +156,7 @@ void strip_html( char *in ) char out[strlen(in)+1]; char *s = out, *cs; int i, matched; + int taglen; memset( out, 0, sizeof( out ) ); @@ -172,9 +173,18 @@ void strip_html( char *in ) while( *in && *in != '>' ) in ++; + taglen = in - cs - 1; /* not <0 because the above loop runs at least once */ if( *in ) { - if( g_strncasecmp( cs+1, "br", 2) == 0 ) + if( g_strncasecmp( cs+1, "b", taglen) == 0 ) + *(s++) = '\x02'; + else if( g_strncasecmp( cs+1, "/b", taglen) == 0 ) + *(s++) = '\x02'; + else if( g_strncasecmp( cs+1, "i", taglen) == 0 ) + *(s++) = '\x1f'; + else if( g_strncasecmp( cs+1, "/i", taglen) == 0 ) + *(s++) = '\x1f'; + else if( g_strncasecmp( cs+1, "br", taglen) == 0 ) *(s++) = '\n'; in ++; } |