diff options
-rw-r--r-- | src/util.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -32,7 +32,8 @@ FILE *open_file(const char *filename, const char *mode) } /* Returns the full path to `filename` by searching the current working - * directory and the path specified by the environment variable SDDM_DATA. + * directory and the path specified by the environment variables SDDM_DATA and + * DQXX_DIR. * * Returns a pointer to the full path on success or NULL if the file isn't * found. */ @@ -53,5 +54,13 @@ char *find_file(const char *filename) if (access(path, F_OK) == 0) return path; } + /* Now check in the directory specified by the environment variable + * DQXX_DIR. */ + dir = getenv("DQXX_DIR"); + if (dir) { + sprintf(path, "%s/%s", dir,filename); + if (access(path, F_OK) == 0) return path; + } + return NULL; } |