#include "configuration.h"
+#undef config_GetDataDir
/**
- * Determines the shared data directory
+ * Determines the shared architecture-independent data directory
*
- * @return a string (always succeeds). Needs to be freed.
+ * @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 strdup( config_GetDataDirDefault() );
+ char *psz_path = var_InheritString( p_obj, "data-path" );
+ return psz_path ? psz_path : config_GetDataDirDefault();
}