aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 0a67e59..4230911 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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;
}