Changeset 04b1aea58e98dc8c44081ae54172829663517db2

Show
Ignore:
Timestamp:
02/13/06 20:14:30 (3 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1139858070 +0000
git-parent:

[49106025613db39dfe53a212341b221286e290c2]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1139858070 +0000
Message:

Replace forbidden characters with underscores when attempting to dump a stream (closes #423)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_filter/record.c

    r543574f r04b1aea  
    22 * record.c 
    33 ***************************************************************************** 
    4  * Copyright (C) 2005 the VideoLAN team 
     4 * Copyright (C) 2005-2006 the VideoLAN team 
    55 * $Id$ 
    66 * 
     
    358358    { 
    359359        input_thread_t *p_input; 
    360         char *psz_name = NULL
     360        char *psz_name = NULL, *psz
    361361        time_t t = time(NULL); 
    362362        struct tm l; 
     
    404404        free( psz_name ); 
    405405 
     406        /* Remove all forbidden characters (except (back)slashes) */ 
     407        for( psz = p_sys->psz_file; *psz; psz++ ) 
     408        { 
     409            unsigned char c = (unsigned char)*psz; 
     410 
     411            /* Even if many OS accept non printable characters, we remove 
     412             * them to avoid confusing users */ 
     413            if( ( c < 32 ) || ( c == 127 ) ) 
     414                *psz = '_'; 
     415#if defined (WIN32) || defined (UNDER_CE) 
     416            /* Windows has a lot of forbidden characters, even if it has 
     417             * fewer than DOS. */ 
     418            if( strchr( "\"*:<>?|", c ) != NULL ) 
     419                *psz = '_'; 
     420#endif 
     421        } 
     422 
    406423        msg_Dbg( p_access, "dump in file '%s'", p_sys->psz_file ); 
    407424