No need to duplicate the environment-adding code in init_env, as we can
just use script_env_set.
Since script_env_set does its own talloc, we don't need to talloc our
strings here either.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
sep - script->filename);
}
- env->name = talloc_strdup(env, "prefix");
+ script_env_set(script, "prefix", prefix ? : default_prefix);
if (prefix)
- env->value = prefix;
- else
- env->value = talloc_strdup(env, default_prefix);
-
- list_add(&script->environment, &env->list);
+ talloc_free(prefix);
}
void script_register_function(struct grub2_script *script,