mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
95e304d111
14
environ.c
14
environ.c
@ -195,19 +195,11 @@ environ_update(const char *vars, struct environ *srcenv,
|
|||||||
void
|
void
|
||||||
environ_push(struct environ *env)
|
environ_push(struct environ *env)
|
||||||
{
|
{
|
||||||
struct environ_entry *envent;
|
struct environ_entry *envent;
|
||||||
char *v;
|
|
||||||
|
|
||||||
while (*environ != NULL) {
|
|
||||||
v = xstrdup(*environ);
|
|
||||||
v[strcspn(v, "=")] = '\0';
|
|
||||||
|
|
||||||
unsetenv(v);
|
|
||||||
free(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
environ = xcalloc(1, sizeof *environ);
|
||||||
RB_FOREACH(envent, environ, env) {
|
RB_FOREACH(envent, environ, env) {
|
||||||
if (envent->value != NULL)
|
if (envent->value != NULL && *envent->name != '\0')
|
||||||
setenv(envent->name, envent->value, 1);
|
setenv(envent->name, envent->value, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user