зеркало из https://github.com/mozilla/gecko-dev.git
fix for #4264 - move fe_GetConfigDir into libxp, because that is in-memory and available for components to use
I've heard rumors that this will break mac, but I'll be able to fix it in one cycle This allows components that don't link against libpref to be loaded and not crash
This commit is contained in:
Родитель
ed3b7b9a02
Коммит
2ea4cc8729
|
@ -1707,4 +1707,29 @@ WH_TempName(XP_FileType type, const char * prefix)
|
|||
|
||||
#endif /* !XP_WIN && !XP_OS2 */
|
||||
|
||||
#ifndef MOZ_USER_DIR
|
||||
#define MOZ_USER_DIR ".mozilla"
|
||||
#endif
|
||||
|
||||
char *fe_GetConfigDir(void) {
|
||||
char *home = getenv("HOME");
|
||||
if (home) {
|
||||
char *config_dir;
|
||||
|
||||
int len = strlen(home);
|
||||
len += strlen("/") + strlen(MOZ_USER_DIR) + 1;
|
||||
|
||||
config_dir = (char *)XP_CALLOC(len, sizeof(char));
|
||||
/* we really should use XP_STRN*_SAFE but this is MODULAR_NETLIB */
|
||||
XP_STRCPY(config_dir, home);
|
||||
XP_STRCAT(config_dir, "/");
|
||||
XP_STRCAT(config_dir, MOZ_USER_DIR);
|
||||
return config_dir;
|
||||
}
|
||||
|
||||
return strdup("/tmp");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -114,25 +114,3 @@ char *fe_GetConfigDirFilename(char *filename)
|
|||
}
|
||||
|
||||
|
||||
#ifndef MOZ_USER_DIR
|
||||
#define MOZ_USER_DIR ".mozilla"
|
||||
#endif
|
||||
|
||||
char *fe_GetConfigDir(void) {
|
||||
char *home = getenv("HOME");
|
||||
if (home) {
|
||||
char *config_dir;
|
||||
|
||||
int len = strlen(home);
|
||||
len += strlen("/") + strlen(MOZ_USER_DIR) + 1;
|
||||
|
||||
config_dir = (char *)XP_CALLOC(len, sizeof(char));
|
||||
/* we really should use XP_STRN*_SAFE but this is MODULAR_NETLIB */
|
||||
XP_STRCPY(config_dir, home);
|
||||
XP_STRCAT(config_dir, "/");
|
||||
XP_STRCAT(config_dir, MOZ_USER_DIR);
|
||||
return config_dir;
|
||||
}
|
||||
|
||||
return strdup("/tmp");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче