diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-06-06 13:13:08 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-06-06 13:13:08 -0500 |
commit | a556c94c1eaffedd2fa1d6ccd73061ab9402cdc0 (patch) | |
tree | 55cdb10b1706236010bba9fb7a5e853dbf58dc4a /src/util.c | |
parent | 9f6454e3f3923a61d1f480d4e1b0303aeeefe7b3 (diff) | |
download | sddm-a556c94c1eaffedd2fa1d6ccd73061ab9402cdc0.tar.gz sddm-a556c94c1eaffedd2fa1d6ccd73061ab9402cdc0.tar.bz2 sddm-a556c94c1eaffedd2fa1d6ccd73061ab9402cdc0.zip |
update find_file() to use the environment variable DQXX_DIR
Diffstat (limited to 'src/util.c')
-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; } |