mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
[config] no-home did not work
This commit is contained in:
parent
2ab64d4a12
commit
ce5cec35c5
@ -88,20 +88,30 @@ test_confdir(const char *home, const char *path,
|
|||||||
char *
|
char *
|
||||||
get_xdg_config_home(void)
|
get_xdg_config_home(void)
|
||||||
{
|
{
|
||||||
|
return xdg_config_home;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
get_xdg_config_home_internal(void)
|
||||||
|
{
|
||||||
|
char *config_dir = NULL;
|
||||||
|
char *elinks_confdir;
|
||||||
|
char *pa;
|
||||||
|
char *g_xdg_config_home;
|
||||||
|
char *home;
|
||||||
|
|
||||||
if (xdg_config_home) {
|
if (xdg_config_home) {
|
||||||
return xdg_config_home;
|
return xdg_config_home;
|
||||||
}
|
}
|
||||||
char *config_dir = NULL;
|
elinks_confdir = getenv("ELINKS_CONFDIR");
|
||||||
char *elinks_confdir = getenv("ELINKS_CONFDIR");
|
pa = get_cmd_opt_str("config-dir");
|
||||||
char *pa = get_cmd_opt_str("config-dir");
|
|
||||||
|
|
||||||
if (elinks_confdir && *elinks_confdir && (!pa || !*pa)) {
|
if (elinks_confdir && *elinks_confdir && (!pa || !*pa)) {
|
||||||
xdg_config_home = test_confdir(NULL, elinks_confdir, NULL);
|
xdg_config_home = test_confdir(NULL, elinks_confdir, NULL);
|
||||||
|
|
||||||
if (xdg_config_home) goto end;
|
if (xdg_config_home) goto end;
|
||||||
}
|
}
|
||||||
char *g_xdg_config_home = getenv("XDG_CONFIG_HOME");
|
g_xdg_config_home = getenv("XDG_CONFIG_HOME");
|
||||||
char *home;
|
|
||||||
|
|
||||||
if (g_xdg_config_home && *g_xdg_config_home) {
|
if (g_xdg_config_home && *g_xdg_config_home) {
|
||||||
xdg_config_home = test_confdir(g_xdg_config_home,
|
xdg_config_home = test_confdir(g_xdg_config_home,
|
||||||
@ -149,6 +159,7 @@ end:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* TODO: Check possibility to use <libgen.h> dirname. */
|
/* TODO: Check possibility to use <libgen.h> dirname. */
|
||||||
static char *
|
static char *
|
||||||
@ -217,7 +228,7 @@ void
|
|||||||
init_home(void)
|
init_home(void)
|
||||||
{
|
{
|
||||||
first_use = 1;
|
first_use = 1;
|
||||||
xdg_config_home = get_xdg_config_home();
|
xdg_config_home = get_xdg_config_home_internal();
|
||||||
if (!xdg_config_home) {
|
if (!xdg_config_home) {
|
||||||
ERROR(gettext("Unable to find or create ELinks config "
|
ERROR(gettext("Unable to find or create ELinks config "
|
||||||
"directory. Please check if you have $HOME "
|
"directory. Please check if you have $HOME "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user