summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2006-04-29 15:22:33 +0000
committersabetts <sabetts>2006-04-29 15:22:33 +0000
commit36f998eb7c667d913cc398881b3b304f242898d8 (patch)
tree2fd1529df65018ff5254b7d5c9eae3b73b14e867 /src/actions.c
parent8fc60a03e05c8ee6f1b0e8e2a50428af2f69f1d4 (diff)
downloadratpoison-36f998eb7c667d913cc398881b3b304f242898d8.zip
(cmd_getenv): return an empty string for
nonexistant env vars.
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c5
1 files changed, 4 insertions, 1 deletions
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