summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-07-15 09:52:35 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-07-15 09:52:35 +0000
commit38ff839da8e195612190346b4849f017205b4a12 (patch)
treeaf0079eb56124720380274eea2c49dc2b961bebc /usr.bin
parent37af3bbb1853eadccd7b19dd1795e72dd6facae8 (diff)
Tweak output of environment logging.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/environ.c12
-rw-r--r--usr.bin/tmux/tmux.h4
-rw-r--r--usr.bin/tmux/window.c4
3 files changed, 12 insertions, 8 deletions
diff --git a/usr.bin/tmux/environ.c b/usr.bin/tmux/environ.c
index a1e66c95d77..c184dd1d51f 100644
--- a/usr.bin/tmux/environ.c
+++ b/usr.bin/tmux/environ.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: environ.c,v 1.14 2016/07/15 09:28:32 nicm Exp $ */
+/* $OpenBSD: environ.c,v 1.15 2016/07/15 09:52:34 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);
+ }
+ }
}
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index cecf1eedf9c..c80771b36d1 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.639 2016/07/15 09:28:32 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.640 2016/07/15 09:52:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1693,7 +1693,7 @@ void environ_put(struct environ *, const char *);
void environ_unset(struct environ *, const char *);
void environ_update(const char *, struct environ *, struct environ *);
void environ_push(struct environ *);
-void environ_log(struct environ *);
+void environ_log(struct environ *, const char *);
/* tty.c */
void tty_create_log(void);
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index fb2e85bb104..b1e11df2b53 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.164 2016/07/15 09:28:32 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.165 2016/07/15 09:52:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -842,7 +842,7 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
log_debug("spawn: %s -- %s", wp->shell, cmd);
for (i = 0; i < wp->argc; i++)
log_debug("spawn: argv[%d] = %s", i, wp->argv[i]);
- environ_log(env);
+ environ_log(env, "spawn: ");
memset(&ws, 0, sizeof ws);
ws.ws_col = screen_size_x(&wp->base);