From 762b64841e652bb4a87da21a9807952872be7040 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 10 Jan 2019 12:46:18 +0100 Subject: 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 '~' --- src/4D_api.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/4D_api.cpp') 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 ) { -- cgit v1.2.3