Commit 5cc2c324 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

BC for ~/.fehrc

parent 788fa40b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ static void feh_load_options_for_theme(char *theme)
	FILE *fp = NULL;
	char *home = getenv("HOME");
	char *rcpath = NULL;
	char *oldrcpath = NULL;
	char *confbase = getenv("XDG_CONFIG_HOME");
	char s[1024], s1[1024], s2[1024];
	int cont = 0;
@@ -156,6 +157,8 @@ static void feh_load_options_for_theme(char *theme)
	if (!home)
		eprintf("You have no HOME, cannot read themes");

	oldrcpath = estrjoin("/", home, ".fehrc", NULL);

	if (confbase)
		rcpath = estrjoin("/", confbase, "feh/themes", NULL);
	else
@@ -165,6 +168,12 @@ static void feh_load_options_for_theme(char *theme)

	free(rcpath);

	if (!fp && ((fp = fopen(oldrcpath, "r")) != NULL))
		weprintf("the config is now read from .config/feh/themes, "
			"please update your path!");

	free(oldrcpath);

	if (!fp && ((fp = fopen("/etc/feh/themes", "r")) == NULL))
		return;