diff options
author | sabetts <sabetts> | 2006-04-29 15:22:33 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2006-04-29 15:22:33 +0000 |
commit | 36f998eb7c667d913cc398881b3b304f242898d8 (patch) | |
tree | 2fd1529df65018ff5254b7d5c9eae3b73b14e867 | |
parent | 8fc60a03e05c8ee6f1b0e8e2a50428af2f69f1d4 (diff) | |
download | ratpoison-36f998eb7c667d913cc398881b3b304f242898d8.zip |
(cmd_getenv): return an empty string for
nonexistant env vars.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/actions.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2006-04-29 Shawn Betts <sabetts@vcn.bc.ca> + + * src/actions.c (cmd_getenv): return an empty string for + nonexistant env vars. + 2006-04-21 Shawn Betts <sabetts@vcn.bc.ca> * src/main.c (print_version): print build date diff --git a/src/actions.c b/src/actions.c index 8f57d7c..216432c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -3743,7 +3743,10 @@ cmd_getenv (int interactive, struct cmdarg **args) char *value; value = getenv (ARG_STRING(0)); - return cmdret_new (RET_SUCCESS, "%s", value); + if (value) + return cmdret_new (RET_SUCCESS, "%s", value); + else + return cmdret_new (RET_SUCCESS, ""); } /* Thanks to Gergely Nagy <algernon@debian.org> for the original |