assigndefined.c (41edb306f05651fcaf6c74f9e3557f59f80292e1) assigndefined.c (efeb8bffe34422937c7f8df836afb5b817366d16)
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
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
11void assigndefined(env)
12 char *env;
11void
12assigndefined(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}
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}