[vlc-devel] commit: Fix config_GetHomeDir by using CSIDL_PERSONAL instead of CSIDL_PROFILE ( Jean-Baptiste Kempf )

git version control git at videolan.org
Wed Jul 30 08:05:16 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jul 29 22:30:35 2008 -0700| [07dabf064c1c6db9db13b62c9ea0b27c67132f68]

Fix config_GetHomeDir by using CSIDL_PERSONAL instead of CSIDL_PROFILE

"Version 5.0. The user's profile folder. A typical path is C:\Documents and Settings\username. Applications should not create files or folders at this level;"

Should fix also the skins2 location (#1787)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=07dabf064c1c6db9db13b62c9ea0b27c67132f68
---

 src/config/dirs.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/config/dirs.c b/src/config/dirs.c
index a4ae46f..2661eb4 100644
--- a/src/config/dirs.c
+++ b/src/config/dirs.c
@@ -46,6 +46,12 @@
 #include <assert.h>
 #include <limits.h>
 
+#if defined( WIN32 )
+# define DIR_SHARE ""
+#else
+# define DIR_SHARE "share"
+#endif
+
 /**
  * config_GetDataDir: find directory where shared data is installed
  *
@@ -58,7 +64,7 @@ const char *config_GetDataDir( void )
 
     if( *path == '\0' )
     {
-        snprintf( path, sizeof( path ), "%s/share",
+        snprintf( path, sizeof( path ), "%s" DIR_SEP DIR_SHARE,
                   vlc_global()->psz_vlcpath );
         path[sizeof( path ) - 1] = '\0';
     }
@@ -80,7 +86,7 @@ const char *config_GetConfDir( void )
 
     if( *path == '\0' )
     {
-        snprintf( path, sizeof( path ), "%s"DIR_SEP"share", /* FIXME: Duh? */
+        snprintf( path, sizeof( path ), "%s"DIR_SEP DIR_SHARE, /* FIXME: Duh? */
                   vlc_global()->psz_vlcpath );
         path[sizeof( path ) - 1] = '\0';
     }
@@ -103,7 +109,7 @@ static const char *GetDir( bool b_appdata )
 # else
     /* Get the "Application Data" folder for the current user */
     if( S_OK == SHGetFolderPathW( NULL,
-              (b_appdata ? CSIDL_APPDATA : CSIDL_PROFILE) | CSIDL_FLAG_CREATE,
+              (b_appdata ? CSIDL_APPDATA : CSIDL_PERSONAL) | CSIDL_FLAG_CREATE,
                                   NULL, SHGFP_TYPE_CURRENT, wdir ) )
 # endif
     {




More information about the vlc-devel mailing list