aboutsummaryrefslogtreecommitdiff
path: root/src/gie.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gie.c')
-rw-r--r--src/gie.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gie.c b/src/gie.c
index 40820e59..9931b2ef 100644
--- a/src/gie.c
+++ b/src/gie.c
@@ -1492,7 +1492,7 @@ static int pj_cart_selftest (void) {
size_t n, sz;
double dist, h, t;
char *args[3] = {"proj=utm", "zone=32", "ellps=GRS80"};
- const char *arg = {"+proj=utm +zone=32 +ellps=GRS80"};
+ char arg[50] = {"+proj=utm; +zone=32; +ellps=GRS80"};
char buf[40];
/* An utm projection on the GRS80 ellipsoid */
@@ -1723,7 +1723,8 @@ static int pj_cart_selftest (void) {
if (strcmp(info.version, tmpstr)) return 55;
}
if (info.release[0] == '\0') return 56;
- if (info.searchpath[0] == '\0') return 57;
+ if (getenv ("HOME") || getenv ("PROJ_LIB"))
+ if (info.searchpath[0] == '\0') return 57;
/* proj_pj_info() */
P = proj_create(PJ_DEFAULT_CTX, "+proj=august"); /* august has no inverse */
@@ -1733,6 +1734,7 @@ static int pj_cart_selftest (void) {
P = proj_create(PJ_DEFAULT_CTX, arg);
pj_info = proj_pj_info(P);
if ( !pj_info.has_inverse ) { proj_destroy(P); return 61; }
+ pj_shrink (arg);
if ( strcmp(pj_info.definition, arg) ) { proj_destroy(P); return 62; }
if ( strcmp(pj_info.id, "utm") ) { proj_destroy(P); return 63; }