Changeset 04b1aea58e98dc8c44081ae54172829663517db2
- 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
| r543574f |
r04b1aea |
|
| 2 | 2 | * record.c |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 2005 the VideoLAN team |
|---|
| | 4 | * Copyright (C) 2005-2006 the VideoLAN team |
|---|
| 5 | 5 | * $Id$ |
|---|
| 6 | 6 | * |
|---|
| … | … | |
| 358 | 358 | { |
|---|
| 359 | 359 | input_thread_t *p_input; |
|---|
| 360 | | char *psz_name = NULL; |
|---|
| | 360 | char *psz_name = NULL, *psz; |
|---|
| 361 | 361 | time_t t = time(NULL); |
|---|
| 362 | 362 | struct tm l; |
|---|
| … | … | |
| 404 | 404 | free( psz_name ); |
|---|
| 405 | 405 | |
|---|
| | 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 | |
|---|
| 406 | 423 | msg_Dbg( p_access, "dump in file '%s'", p_sys->psz_file ); |
|---|
| 407 | 424 | |
|---|