aboutsummaryrefslogtreecommitdiff
path: root/src/4D_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-27 18:14:56 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-27 18:45:07 +0100
commitea6245ea32f0b0ee414c22951b1f5dc4048782de (patch)
tree65b0e20d6a42840384b9aab01f0667f79fbfa582 /src/4D_api.cpp
parenta4c5cc1e42559f1d92c6b7655680d11f1eead703 (diff)
downloadPROJ-ea6245ea32f0b0ee414c22951b1f5dc4048782de.tar.gz
PROJ-ea6245ea32f0b0ee414c22951b1f5dc4048782de.zip
projinfo: add --searchpaths switch
Diffstat (limited to 'src/4D_api.cpp')
-rw-r--r--src/4D_api.cpp19
1 files changed, 3 insertions, 16 deletions
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);