static char *get_epidir(void)
{
char *basedir, *epidir;
+ struct stat s;
+
basedir = get_basedir();
xasprintf(&epidir, "%s/epigrams", basedir);
free(basedir);
+ if (!OPT_GIVEN(TFORTUNE, BASEDIR) && stat(epidir, &s) < 0) {
+ free(epidir);
+ epidir = xstrdup(DATADIR "/tfortunes/epigrams");
+ INFO_LOG("falling back to system-wide epidir %s\n", epidir);
+ }
return epidir;
}