*
* @return a nul-terminated string or NULL. Use free() to release it.
*/
-char *config_GetDataDirDefault (void)
+char *config_GetDataDir (void)
{
- char *datadir = config_GetLibDir();
+ const char *path = getenv ("VLC_DATA_PATH");
+ if (path)
+ return strdup (path);
+ char *datadir = config_GetLibDir();
if (datadir)
/* replace last lib\vlc with share */
strcpy ( datadir + strlen (datadir) - 7, "share");
-
return datadir;
}
-/**
- * Determines the system configuration directory.
- *
- * @return a string (always succeeds).
- */
-const char *config_GetConfDir( void )
+static char *config_GetHomeDir (void)
{
-#warning FIXME: memory leak
- return config_GetLibDir ();
+ const char *home = getenv ("HOME");
+ if (home != NULL)
+ return FromLocaleDup (home);
+
+ return config_GetLibDir();
}
char *config_GetUserDir (vlc_userdir_t type)
case VLC_VIDEOS_DIR:
break;
}
- return config_GetLibDir ();
+ return config_GetHomeDir ();
}