aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/4D_api.cpp10
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 ) {