xref: /freebsd/sbin/ipf/libipf/assigndefined.c (revision 716fd348e01c5f2ba125f878a634a753436c2994)
1 /*
2  * Copyright (C) 2012 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: assigndefined.c,v 1.4.2.2 2012/07/22 08:04:24 darren_r Exp $
7  */
8 
9 #include "ipf.h"
10 
11 void
12 assigndefined(char *env)
13 {
14 	char *s, *t;
15 
16 	if (env == NULL)
17 		return;
18 
19 	for (s = strtok(env, ";"); s != NULL; s = strtok(NULL, ";")) {
20 		t = strchr(s, '=');
21 		if (t == NULL)
22 			continue;
23 		*t++ = '\0';
24 		set_variable(s, t);
25 		*--t = '=';
26 	}
27 }
28