From 72f4f49bf3a2f95e4c2f4571205aa0925f20449a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 15 Mar 2021 15:37:44 +0100 Subject: Add support for PROJ_AUX_DB environment variable to set the path to one or several auxiliary DBs --- src/ctx.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ctx.cpp') diff --git a/src/ctx.cpp b/src/ctx.cpp index 097633ae..cc9df6c3 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -91,13 +91,16 @@ pj_ctx pj_ctx::createDefault() ctx.logger = pj_stderr_logger; NS_PROJ::FileManager::fillDefaultNetworkInterface(&ctx); - if( getenv("PROJ_DEBUG") != nullptr ) + const char* projDebug = getenv("PROJ_DEBUG"); + if( projDebug != nullptr ) { - if( atoi(getenv("PROJ_DEBUG")) >= -PJ_LOG_TRACE ) - ctx.debug_level = atoi(getenv("PROJ_DEBUG")); + const int debugLevel = atoi(projDebug); + if( debugLevel >= -PJ_LOG_TRACE ) + ctx.debug_level = debugLevel; else ctx.debug_level = PJ_LOG_TRACE; } + return ctx; } -- cgit v1.2.3