git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35467 15284696-431f-4ddb-bdfa-cd5b030d7da7
@@ -518,10 +518,12 @@ void G__create_alt_env(void)
int i;
/* copy env to env2 */
- st->env2 = st->env;
-
+ G_copy(&st->env2, &st->env, sizeof(st->env));
+
st->env.count = 0;
+ st->env.size = 0;
+ st->env.binds = NULL;
for (i = 0; i < st->env2.count; i++) {
struct bind *b = &st->env2.binds[i];
if (b->name)