eliminate non-valid characters only on the name not on the full path (closes #628)
authorChristophe Mutricy <xtophe@videolan.org>
Fri, 7 Apr 2006 21:45:01 +0000 (21:45 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Fri, 7 Apr 2006 21:45:01 +0000 (21:45 +0000)
modules/access_filter/record.c

index 2afdf91..d36a68f 100644 (file)
@@ -396,8 +396,8 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
         if( psz_name == NULL )
             psz_name = strdup( "Unknown" );
 
-        asprintf( &p_sys->psz_file, "%s/%s %d-%d-%d %.2dh%.2dm%.2ds.%s",
-                  p_sys->psz_path, psz_name,
+        asprintf( &p_sys->psz_file, "%s %d-%d-%d %.2dh%.2dm%.2ds.%s",
+                  psz_name,
                   l.tm_mday, l.tm_mon+1, l.tm_year+1900,
                   l.tm_hour, l.tm_min, l.tm_sec,
                   p_sys->psz_ext );
@@ -421,6 +421,17 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
 #endif
         }
 
+        psz_name=strdup(p_sys->psz_file);
+
+#if defined (WIN32) || defined (UNDER_CE)
+#define DIR_SEP "\\"
+#else
+#define DIR_SEP "/"
+#endif
+        asprintf(&p_sys->psz_file, "%s" DIR_SEP "%s",
+                 p_sys->psz_path, psz_name);
+        free(psz_name);
+
         msg_Dbg( p_access, "dump in file '%s'", p_sys->psz_file );
 
         p_sys->f = utf8_fopen( p_sys->psz_file, "wb" );