Changeset 0bf39ed37db37db3d1c925e3af7a742ff251a522

Show
Ignore:
Timestamp:
28/02/07 21:41:01 (2 years ago)
Author:
Yoann Peronneau <yoann@videolan.org>
git-committer:
Yoann Peronneau <yoann@videolan.org> 1172695261 +0000
git-parent:

[7815fcbd8eddee11d31daee6663c8937f38771c2]

git-author:
Yoann Peronneau <yoann@videolan.org> 1172695261 +0000
Message:

* src/playlist/loadsave.c: create directory before saving Media Library

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/playlist/loadsave.c

    r2a347b1d r0bf39ed  
    2424#include <vlc_playlist.h> 
    2525#include "playlist_internal.h" 
     26#include "misc/configuration.h" 
    2627#include <vlc_charset.h> 
    2728 
     
    119120int playlist_MLDump( playlist_t *p_playlist ) 
    120121{ 
    121     char *psz_uri, *psz_homedir =p_playlist->p_libvlc->psz_homedir; 
     122    char *psz_uri, *psz_homedir = p_playlist->p_libvlc->psz_homedir; 
    122123    if( !config_GetInt( p_playlist, "media-library") ) return VLC_SUCCESS; 
    123124    if( !psz_homedir ) 
    124125    { 
    125         msg_Err( p_playlist, "no home directory, cannot load media library") ; 
     126        msg_Err( p_playlist, "no home directory, cannot save media library") ; 
    126127        return VLC_EGENERIC; 
    127128    } 
    128     asprintf( &psz_uri, "%s" DIR_SEP CONFIG_DIR DIR_SEP 
     129 
     130    char psz_dirname[ strlen( psz_homedir ) + sizeof( DIR_SEP CONFIG_DIR ) ]; 
     131    sprintf( psz_dirname, "%s" DIR_SEP CONFIG_DIR, psz_homedir ); 
     132    if( config_CreateDir( (vlc_object_t *)p_playlist, psz_dirname ) ) 
     133    { 
     134        return VLC_EGENERIC; 
     135    } 
     136 
     137    asprintf( &psz_uri, "%s" DIR_SEP "%s", psz_dirname, 
    129138                        "ml.xsp",  psz_homedir ); 
    130139    stats_TimerStart( p_playlist, "ML Dump", STATS_TIMER_ML_DUMP );