xref: /netbsd-src/external/bsd/ipf/dist/lib/assigndefined.c (revision b757af438b42b93f8c6571f026d8b8ef3eaf5fc9)
1 /*	$NetBSD: assigndefined.c,v 1.1.1.1 2012/03/23 21:20:07 christos Exp $	*/
2 
3 /*
4  * Copyright (C) 2009 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * Id: assigndefined.c,v 1.4.2.1 2012/01/26 05:44:26 darren_r Exp
9  */
10 
11 #include "ipf.h"
12 
13 void assigndefined(env)
14 	char *env;
15 {
16 	char *s, *t;
17 
18 	if (env == NULL)
19 		return;
20 
21 	for (s = strtok(env, ";"); s != NULL; s = strtok(NULL, ";")) {
22 		t = strchr(s, '=');
23 		if (t == NULL)
24 			continue;
25 		*t++ = '\0';
26 		set_variable(s, t);
27 		*--t = '=';
28 	}
29 }
30