From 3d082689d468828e62f101c9755c8d42202a0ea1 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 11 Sep 2019 17:43:38 +0200 Subject: DatabaseContext::lookForGridInfo(): avoid setting PROJ context errno. Fixes issue with test/gigs/5208.gie with previous commit when ntf_r93.gsb grid is not available --- src/iso19111/factory.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/iso19111/factory.cpp') diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index 3ed69ae9..9ecc0906 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -1000,9 +1000,11 @@ bool DatabaseContext::lookForGridInfo(const std::string &projFilename, if (d->pjCtxt() == nullptr) { d->setPjCtxt(pj_get_default_ctx()); } + int errno_before = proj_context_errno(d->pjCtxt()); gridAvailable = pj_find_file(d->pjCtxt(), projFilename.c_str(), &fullFilename[0], fullFilename.size() - 1) != 0; + proj_context_errno_set(d->pjCtxt(), errno_before); fullFilename.resize(strlen(fullFilename.c_str())); auto res = -- cgit v1.2.3