mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[home] Restored ELINKS_CONFDIR . Refs #199
This commit is contained in:
parent
d9f9478cc5
commit
d8ba111010
@ -56,6 +56,11 @@ EDITOR::
|
||||
|
||||
The program to use for external editor (when editing textareas).
|
||||
|
||||
ELINKS_CONFDIR::
|
||||
|
||||
If set the location of the directory containing configuration files.
|
||||
If not set see below.
|
||||
|
||||
XDG_CONFIG_HOME::
|
||||
|
||||
The location of the directory containing configuration files. If set
|
||||
|
@ -324,6 +324,12 @@ The path to the users home directory\&. Used when expanding
|
||||
~/\&.
|
||||
.RE
|
||||
.PP
|
||||
ELINKS_CONFDIR
|
||||
.RS 4
|
||||
If set the location of the directory containing configuration files.
|
||||
If not set see below.
|
||||
.RE
|
||||
.PP
|
||||
XDG_CONFIG_HOME
|
||||
.RS 4
|
||||
If set the location of the directory containing configuration files
|
||||
|
@ -91,13 +91,21 @@ get_xdg_config_home(void)
|
||||
if (xdg_config_home) {
|
||||
return xdg_config_home;
|
||||
}
|
||||
char *config_dir = NULL;
|
||||
char *elinks_confdir = getenv("ELINKS_CONFDIR");
|
||||
char *pa = get_cmd_opt_str("config-dir");
|
||||
|
||||
if (elinks_confdir && *elinks_confdir && (!pa || !*pa)) {
|
||||
xdg_config_home = test_confdir(NULL, elinks_confdir, NULL);
|
||||
|
||||
if (xdg_config_home) goto end;
|
||||
}
|
||||
char *g_xdg_config_home = getenv("XDG_CONFIG_HOME");
|
||||
char *home;
|
||||
char *config_dir = NULL;
|
||||
|
||||
if (g_xdg_config_home && *g_xdg_config_home) {
|
||||
xdg_config_home = test_confdir(g_xdg_config_home,
|
||||
get_cmd_opt_str("config-dir"),
|
||||
pa,
|
||||
N_("Commandline options -config-dir set to %s, "
|
||||
"but could not create directory %s."));
|
||||
if (xdg_config_home) {
|
||||
@ -122,7 +130,7 @@ get_xdg_config_home(void)
|
||||
return NULL;
|
||||
}
|
||||
xdg_config_home = test_confdir(config_dir,
|
||||
get_cmd_opt_str("config-dir"),
|
||||
pa,
|
||||
N_("Commandline options -config-dir set to %s, "
|
||||
"but could not create directory %s."));
|
||||
if (xdg_config_home) {
|
||||
|
Loading…
Reference in New Issue
Block a user