mirror of
https://github.com/swaywm/sway.git
synced 2024-11-10 12:33:50 +01:00
act on child_envp instead of global environment variables
This commit is contained in:
parent
f7d611af7b
commit
124b1f1248
@ -1,14 +1,17 @@
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <stdlib.h>
|
||||
#include <glib.h>
|
||||
#include "sway/commands.h"
|
||||
|
||||
extern char **child_envp;
|
||||
|
||||
struct cmd_results *cmd_env(int argc, char **argv) {
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "env", EXPECTED_EQUAL_TO, 2))) {
|
||||
return error;
|
||||
}
|
||||
|
||||
setenv(argv[0], argv[1], 1);
|
||||
child_envp = g_environ_setenv(child_envp, argv[0], argv[1], 1);
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user