version 1.21, 2019/03/18 11:58:40 |
version 1.22, 2019/04/23 20:36:55 |
|
|
struct environ_entry *envent; |
struct environ_entry *envent; |
struct options_entry *o; |
struct options_entry *o; |
struct options_array_item *a; |
struct options_array_item *a; |
const char *value; |
union options_value *ov; |
|
|
o = options_get(oo, "update-environment"); |
o = options_get(oo, "update-environment"); |
if (o == NULL) |
if (o == NULL) |
return; |
return; |
a = options_array_first(o); |
a = options_array_first(o); |
while (a != NULL) { |
while (a != NULL) { |
value = options_array_item_value(a); |
ov = options_array_item_value(a); |
if (value == NULL) { |
if (ov == NULL) { |
a = options_array_next(a); |
a = options_array_next(a); |
continue; |
continue; |
} |
} |
if ((envent = environ_find(src, value)) == NULL) |
if ((envent = environ_find(src, ov->string)) == NULL) |
environ_clear(dst, value); |
environ_clear(dst, ov->string); |
else |
else |
environ_set(dst, envent->name, "%s", envent->value); |
environ_set(dst, envent->name, "%s", envent->value); |
a = options_array_next(a); |
a = options_array_next(a); |