diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-01-10 12:46:18 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-01-10 12:46:18 +0100 |
| commit | 762b64841e652bb4a87da21a9807952872be7040 (patch) | |
| tree | d0012fc6ee9e62011e401991423c2e88e43c1f35 /src/4D_api.cpp | |
| parent | 19dd0531886835b0012d179beb6f3e2ceb9b8983 (diff) | |
| download | PROJ-762b64841e652bb4a87da21a9807952872be7040.tar.gz PROJ-762b64841e652bb4a87da21a9807952872be7040.zip | |
proj_info(): report the hardcoded PROJ_LIB path in info.searchpath (if the env variable is not defined), and no longer report HOME that is only used for files starting with '~'
Diffstat (limited to 'src/4D_api.cpp')
| -rw-r--r-- | src/4D_api.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp index cdfaa8b2..ba292262 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -1032,9 +1032,13 @@ PJ_INFO proj_info (void) { info.release = pj_get_release (); /* build search path string */ - buf = path_append (buf, getenv ("HOME"), &buf_size); - buf = path_append (buf, getenv ("PROJ_LIB"), &buf_size); - + const char* envPROJ_LIB = getenv ("PROJ_LIB"); + buf = path_append (buf, envPROJ_LIB, &buf_size); +#ifdef PROJ_LIB + if( envPROJ_LIB == nullptr ) { + buf = path_append (buf, PROJ_LIB, &buf_size); + } +#endif auto ctx = pj_get_default_ctx(); if( ctx ) { for( const auto& path: ctx->search_paths ) { |
