Revert "update: allow update_Download to accept: directory, filename, NULL"
authorRafaël Carré <rafael.carre@gmail.com>
Thu, 20 Aug 2009 06:08:24 +0000 (08:08 +0200)
committerRafaël Carré <rafael.carre@gmail.com>
Thu, 20 Aug 2009 06:08:24 +0000 (08:08 +0200)
This reverts commit 0f245d7bdd245fb84181d8911d72bbc62f099844.

Conflicts:

src/misc/update.c

src/misc/update.c

index eb88e33..7cbaea0 100644 (file)
@@ -35,9 +35,6 @@
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
-#ifdef HAVE_SYS_STAT_H
-#   include <sys/stat.h>
-#endif
 
 #include <vlc_common.h>
 #include <vlc_update.h>
@@ -537,7 +534,6 @@ static void* update_DownloadReal( vlc_object_t *p_this )
     char *psz_tmpdestfile = NULL;
 
     FILE *p_file = NULL;
-    struct stat p_stat;
     stream_t *p_stream = NULL;
     void* p_buffer = NULL;
     int i_read;
@@ -569,16 +565,8 @@ static void* update_DownloadReal( vlc_object_t *p_this )
         goto end;
     }
     psz_tmpdestfile++;
-
-    if( utf8_stat( psz_destdir, &p_stat) == 0 && (p_stat.st_mode & S_IFDIR) )
-    {
-        if( asprintf( &psz_destfile, "%s%c%s", psz_destdir, DIR_SEP_CHAR, psz_tmpdestfile ) == -1 )
-            goto end;
-    }
-    else if( psz_destdir )
-        psz_destfile = strdup( psz_destdir );
-    else
-        psz_destfile = strdup( psz_tmpdestfile );
+    if( asprintf( &psz_destfile, "%s%s", psz_destdir, psz_tmpdestfile ) == -1 )
+        goto end;
 
     p_file = utf8_fopen( psz_destfile, "w" );
     if( !p_file )