]> git.sesse.net Git - vlc/blobdiff - src/config/dirs.c
config_PutPsz: reduce lock contention scope
[vlc] / src / config / dirs.c
index 695b9455508dcc9781cac238ed6a21f79a54d34f..22a5bdcab54f9fa0c4a07a7a50abebc1d45a96bf 100644 (file)
 
 #include "configuration.h"
 
+#undef config_GetDataDir
 /**
- * Determines the shared data directory
+ * Determines the shared architecture-independent data directory
  *
  * @return a string or NULL. Use free() to release.
  */
-char *__config_GetDataDir( vlc_object_t *p_obj )
+char *config_GetDataDir( vlc_object_t *p_obj )
 {
-    char *psz_path = config_GetPsz( p_obj, "data-path" );
-    if( psz_path && *psz_path )
-        return psz_path;
-    free( psz_path );
-    return config_GetDataDirDefault();
+    char *psz_path = var_InheritString( p_obj, "data-path" );
+    return psz_path ? psz_path : config_GetDataDirDefault();
 }