Changeset 717e3bf for protocols


Ignore:
Timestamp:
2007-04-17T03:57:30Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
9624fdf
Parents:
b3cae44
Message:

Hopefully improved Yahoo! "markup" stripping.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/yahoo.c

    rb3cae44 r717e3bf  
    7171        int len;
    7272       
    73         /* This should get rid of HTML tags at the beginning of the string. */
     73        /* This should get rid of the markup noise at the beginning of the string. */
    7474        while( *in )
    7575        {
     
    101101        }
    102102       
    103         /* This is supposed to get rid of the closing HTML tags at the end of the line. */
     103        /* This is supposed to get rid of the noise at the end of the line. */
    104104        len = strlen( in );
    105         while( len > 0 && in[len-1] == '>' )
     105        while( len > 0 && ( in[len-1] == '>' || in[len-1] == 'm' ) )
    106106        {
    107107                int blen = len;
    108                
    109                 len --;
    110                 while( len > 0 && ( in[len] != '<' || in[len+1] != '/' ) )
     108                const char *search;
     109               
     110                if( in[len-1] == '>' )
     111                        search = "</";
     112                else
     113                        search = "\e[";
     114               
     115                len -= 3;
     116                while( len > 0 && strncmp( in + len, search, 2 ) != 0 )
    111117                        len --;
    112118               
    113                 if( len == 0 && ( in[len] != '<' || in[len+1] != '/' ) )
     119                if( len <= 0 && strncmp( in, search, 2 ) != 0 )
    114120                {
    115121                        len = blen;
Note: See TracChangeset for help on using the changeset viewer.