Use a larger buffer when parsing the `.gisrc` file. Use `GPATH_MAX` to fit whatever would fit in the path value, plus the length of the key. Fixes #1373.
@@ -115,8 +115,10 @@ void G__read_gisrc_env(void)
}
static void parse_env(FILE *fd, int loc)
-{
- char buf[200];
+{
+ /* Account for long lines up to GPATH_MAX.
+ E.g. "GISDBASE: GPATH_MAX\n\0" */
+ char buf[GPATH_MAX + 16];
char *name;
char *value;