+ /* Remove all forbidden characters (except (back)slashes) */
+ for( psz = p_sys->psz_file; *psz; psz++ )
+ {
+ unsigned char c = (unsigned char)*psz;
+
+ /* Even if many OS accept non printable characters, we remove
+ * them to avoid confusing users */
+ if( ( c < 32 ) || ( c == 127 ) )
+ *psz = '_';
+#if defined (WIN32) || defined (UNDER_CE)
+ /* Windows has a lot of forbidden characters, even if it has
+ * fewer than DOS. */
+ if( strchr( "\"*:<>?|", c ) != NULL )
+ *psz = '_';
+#endif
+ }
+
+ psz_name = p_sys->psz_file;
+
+#if defined (WIN32) || defined (UNDER_CE)
+#define DIR_SEP "\\"
+#else
+#define DIR_SEP "/"
+#endif
+ if( asprintf( &p_sys->psz_file, "%s" DIR_SEP "%s",
+ p_sys->psz_path, psz_name ) == -1 )
+ p_sys->psz_file = NULL;