From ea6245ea32f0b0ee414c22951b1f5dc4048782de Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 27 Jan 2020 18:14:56 +0100 Subject: projinfo: add --searchpaths switch --- src/4D_api.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/4D_api.cpp') diff --git a/src/4D_api.cpp b/src/4D_api.cpp index dabd44a0..91510c35 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -1484,23 +1484,10 @@ PJ_INFO proj_info (void) { /* build search path string */ auto ctx = pj_get_default_ctx(); if (!ctx || ctx->search_paths.empty()) { - // Env var mostly for testing purposes and being independent from - // an existing installation - const char* ignoreUserWritableDirectory = - getenv("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY"); - if( ignoreUserWritableDirectory == nullptr || - ignoreUserWritableDirectory[0] == '\0' ) { - buf = path_append(buf, - pj_context_get_user_writable_directory(ctx, false).c_str(), - &buf_size); - } - const std::string envPROJ_LIB = NS_PROJ::FileManager::getProjLibEnvVar(ctx); - buf = path_append(buf, envPROJ_LIB.empty() ? nullptr : envPROJ_LIB.c_str(), &buf_size); -#ifdef PROJ_LIB - if (envPROJ_LIB.empty()) { - buf = path_append(buf, PROJ_LIB, &buf_size); + const auto searchpaths = pj_get_default_searchpaths(ctx); + for( const auto& path: searchpaths ) { + buf = path_append(buf, path.c_str(), &buf_size); } -#endif } else { for (const auto &path : ctx->search_paths) { buf = path_append(buf, path.c_str(), &buf_size); -- cgit v1.2.3