]> git.sesse.net Git - vlc/commitdiff
update: rename the variables so that it matches their current purpose
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 2 Oct 2008 14:38:39 +0000 (16:38 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 2 Oct 2008 14:38:39 +0000 (16:38 +0200)
src/misc/update.c
src/misc/update.h

index 2eac20adfc945686502a1aecad4ffafdeb00ea7f..0f54cd5d12d28620b3b69d68a8773be6ee4c4258 100644 (file)
@@ -1485,10 +1485,12 @@ static void* update_DownloadReal( vlc_object_t *p_this );
  * Download the file given in the update_t
  *
  * \param p_update structure
- * \param dir to store the download file
+ * \param destination to store the download file
+ *        This can be an existing dir, a (non)existing target fullpath filename or
+ *        NULL for the current working dir.
  * \return nothing
  */
-void update_Download( update_t *p_update, const char *psz_destdir )
+void update_Download( update_t *p_update, const char *destination )
 {
     assert( p_update );
 
@@ -1500,7 +1502,7 @@ void update_Download( update_t *p_update, const char *psz_destdir )
 
     p_udt->p_update = p_update;
     p_update->p_download = p_udt;
-    p_udt->psz_destdir = psz_destdir ? strdup( psz_destdir ) : NULL;
+    p_udt->psz_destination = destination ? strdup( destination ) : NULL;
 
     vlc_thread_create( p_udt, "download update", update_DownloadReal,
                        VLC_THREAD_PRIORITY_LOW, false );
@@ -1527,7 +1529,7 @@ static void* update_DownloadReal( vlc_object_t *p_this )
     int canc;
 
     update_t *p_update = p_udt->p_update;
-    char *psz_destdir = p_udt->psz_destdir;
+    char *psz_destination = p_udt->psz_destination;
 
     msg_Dbg( p_udt, "Opening Stream '%s'", p_update->release.psz_url );
     canc = vlc_savecancel ();
@@ -1553,13 +1555,13 @@ static void* update_DownloadReal( vlc_object_t *p_this )
     }
     psz_tmpdestfile++;
 
-    if( utf8_stat( psz_destdir, &p_stat) == 0 && (p_stat.st_mode & S_IFDIR) )
+    if( utf8_stat( psz_destination, &p_stat) == 0 && (p_stat.st_mode & S_IFDIR) )
     {
-        if( asprintf( &psz_destfile, "%s%c%s", psz_destdir, DIR_SEP_CHAR, psz_tmpdestfile ) == -1 )
+        if( asprintf( &psz_destfile, "%s%c%s", psz_destination, DIR_SEP_CHAR, psz_tmpdestfile ) == -1 )
             goto end;
     }
-    else if( psz_destdir )
-        psz_destfile = strdup( psz_destdir );
+    else if( psz_destination )
+        psz_destfile = strdup( psz_destination );
     else
         psz_destfile = strdup( psz_tmpdestfile );
 
@@ -1729,7 +1731,7 @@ end:
         stream_Delete( p_stream );
     if( p_file )
         fclose( p_file );
-    free( psz_destdir );
+    free( psz_destination );
     free( psz_destfile );
     free( p_buffer );
     free( psz_size );
index c092cf5e54e81a25b7088f2a0870d82c5d9d37f9..59ac20a3e60d5aeb82be24c0b61ec9b9b8aaf033 100644 (file)
@@ -149,7 +149,7 @@ typedef struct
 {
     VLC_COMMON_MEMBERS
     update_t *p_update;
-    char *psz_destdir;
+    char *psz_destination;
 } update_download_thread_t;
 
 /**