Changeset 252c882286e56574f7984bf23ad8b456fc3d9805

Show
Ignore:
Timestamp:
23/09/08 00:04:18 (2 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1222121058 +0200
git-parent:

[897a63f65b1af3abf8038f02a6bd3f2491bc3eeb]

git-author:
Laurent Aimar <fenrir@videolan.org> 1222121058 +0200
Message:

Use resolve_xml_special_chars where appropriate.

(noticed by Antoine Cellerier)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/misc/freetype.c

    rc8b3f40 r252c882  
    4141#include <vlc_xml.h> 
    4242#include <vlc_input.h> 
     43#include <vlc_strings.h> 
    4344 
    4445#include <math.h> 
  • modules/misc/quartztext.c

    r0c4e17d r252c882  
    3939#include <vlc_xml.h> 
    4040#include <vlc_input.h> 
     41#include <vlc_strings.h> 
    4142 
    4243#include <math.h> 
  • modules/misc/text_renderer.h

    r07a682d r252c882  
    495495 
    496496/* */ 
    497 static void HandleMarkup( char *psz_node ) 
    498 { 
    499     static const struct 
    500     { 
    501         const char *psz_pattern; 
    502         char i_char; 
    503     } p_replace[] = { 
    504         { "&lt;",   '<' }, 
    505         { "&gt;",   '>' }, 
    506         { "&amp;",  '&' }, 
    507         { "&quot;", '"' }, 
    508         /* This one will always match */ 
    509         { "&",      '&' } 
    510     }; 
    511  
    512     char *s = psz_node; 
    513     while( ( s = strchr( s, '&' ) ) != NULL ) 
    514     { 
    515         size_t i_size; 
    516         int i; 
    517         for( i = 0; ; i++ ) 
    518         { 
    519             i_size = strlen(p_replace[i].psz_pattern); 
    520             if( !strncmp( s, p_replace[i].psz_pattern, i_size ) ) 
    521                 break; 
    522         } 
    523         if( i_size > 1 ) 
    524             memmove( &s[1], &s[i_size], 
    525                      strlen( s ) - i_size + 1 ); 
    526         *s++ = p_replace[i].i_char; 
    527     } 
    528 } 
    529  
    530497static int ProcessNodes( filter_t *p_filter, 
    531498                         xml_reader_t *p_xml_reader, 
     
    655622                    /* */ 
    656623                    HandleWhiteSpace( psz_node ); 
    657                     HandleMarkup( psz_node ); 
     624                    resolve_xml_special_chars( psz_node ); 
    658625 
    659626                    SetupLine( p_filter, psz_node, &psz_text,