summaryrefslogtreecommitdiffstats
path: root/environ.c
diff options
context:
space:
mode:
authornicm <nicm>2016-07-15 09:52:34 +0000
committernicm <nicm>2016-07-15 09:52:34 +0000
commit9436a316038d1d1c9bc161d282564ed67e2f8ce2 (patch)
tree94ce74679bcebc49fb2902c51758e7d94730675a /environ.c
parent1718420c48737a3038966611c83f37f3c272901e (diff)
Tweak output of environment logging.
Diffstat (limited to 'environ.c')
-rw-r--r--environ.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/environ.c b/environ.c
index 7709f29d..5d06afbf 100644
--- a/environ.c
+++ b/environ.c
@@ -206,10 +206,14 @@ environ_push(struct environ *env)
/* Log the environment. */
void
-environ_log(struct environ *env)
+environ_log(struct environ *env, const char *prefix)
{
struct environ_entry *envent;
- RB_FOREACH(envent, environ, env)
- log_debug("%s=%s", envent->name, envent->value);
+ RB_FOREACH(envent, environ, env) {
+ if (envent->value != NULL && *envent->name != '\0') {
+ log_debug("%s%s=%s", prefix, envent->name,
+ envent->value);
+ }
+ }
}