зеркало из https://github.com/mozilla/pjs.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:
Родитель
c70774e5a9
Коммит
8d7eb39b2a
|
@ -1707,4 +1707,29 @@ WH_TempName(XP_FileType type, const char * prefix)
|
||||||
|
|
||||||
#endif /* !XP_WIN && !XP_OS2 */
|
#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");
|
|
||||||
}
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче