diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-10-09 11:41:19 -0700 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-10-09 11:41:19 -0700 |
commit | 619770237590e4a760346f2e12681d7e2220dda4 (patch) | |
tree | 8d0d391407280ab74e1fc876d6f272110b474897 /lib/misc.c | |
parent | 23b29c67968f3dd39e7d6970acc5669556f4c8b9 (diff) | |
parent | 27b407fde1844a0e03f1a9d92d2a1c4a40435f9b (diff) |
Merging OTR branch. It's more or less a plugin if you enable it, and
otherwise a no-op. DO NOT INSTALL THIS ON PUBLIC SERVERS.
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 ++; } |