diff options
author | sabetts <sabetts> | 2001-09-18 06:47:06 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-09-18 06:47:06 +0000 |
commit | 3417b6981960f0c8ca0a5bf18a75386a10fdc719 (patch) | |
tree | 0b6fd50bcae2f2eb35e19ea4dbcf6e2e7b57731a | |
parent | 445978d53f43962da85830a396aaf3acd021219a (diff) | |
download | ratpoison-3417b6981960f0c8ca0a5bf18a75386a10fdc719.zip |
* src/actions.h (cmd_unsetenv): new prototype
* src/actions.c (cmd_unsetenv): new function
(user_commands): new "unsetenv" command
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | src/actions.c | 15 | ||||
-rw-r--r-- | src/actions.h | 1 |
4 files changed, 27 insertions, 0 deletions
@@ -1,5 +1,10 @@ 2001-09-17 shawn <sabetts@diggin.lamenet.tmp> + * src/actions.h (cmd_unsetenv): new prototype + + * src/actions.c (cmd_unsetenv): new function + (user_commands): new "unsetenv" command + * src/ratpoison.h (xstrdup): new prototype * src/main.c (xstrdup): new function. All calls to strdup replaced @@ -1,6 +1,12 @@ ratpoison NEWS --- history of user-visible changes. -*- outline -*- * Changes since 1.0.0 +** New command unsetenv +Remove an environment variable from...well...the environment. + +** New command chdir +Change the current directory. + ** Multiple commands passed to ratpoison via the command-line are now processed A stream of commands like, `ratpoison -c next -c prev -c next' are processed in order. diff --git a/src/actions.c b/src/actions.c index afa855a..5bf33ea 100644 --- a/src/actions.c +++ b/src/actions.c @@ -67,6 +67,7 @@ static user_command user_commands[] = {"windows", cmd_windows, arg_VOID}, {"setenv", cmd_setenv, arg_STRING}, {"chdir", cmd_chdir, arg_STRING}, + {"unsetenv", cmd_unsetenv, arg_STRING}, /* Commands to set default behavior. */ {"defbarloc", cmd_defbarloc, arg_STRING}, @@ -1824,3 +1825,17 @@ cmd_chdir (int interactive, void *data) chdir ((char *)data); return NULL; } + +char * +cmd_unsetenv (int interactive, void *data) +{ + if (data == NULL) + { + message (" unsetenv: One argument is required "); + return NULL; + } + + unsetenv ((char *)data); + + return NULL; +} diff --git a/src/actions.h b/src/actions.h index 0658c49..c73fdba 100644 --- a/src/actions.h +++ b/src/actions.h @@ -92,6 +92,7 @@ char * cmd_deffgcolor (int interactive, void *data); char * cmd_defbgcolor (int interactive, void *data); char * cmd_setenv (int interactive, void *data); char * cmd_chdir (int interactive, void *data); +char * cmd_unsetenv (int interactive, void *data); /* void cmd_xterm (void *data); */ |