aboutsummaryrefslogblamecommitdiffstats
path: root/libexec_set_environ.c
blob: 1d344d042e5b2de33106a5bf1454f75d66884cfe (plain) (tree)

























                                                            
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifndef TEST


void
libexec_set_environ(struct libexec_command *cmd, char **env)
{
	size_t i;

	if (!cmd)
		return;

	if (cmd->environ) {
		for (i = 0; cmd->environ[i]; i++)
			free(cmd->environ[i]);
		free(cmd->environ);
	}

	cmd->environ = env;
}


#else
LIBEXEC_CONST__ int main(void) {return 0;} /* TODO test */
#endif