aboutsummaryrefslogtreecommitdiff
path: root/cmd-show-environment.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-show-environment.c')
-rw-r--r--cmd-show-environment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd-show-environment.c b/cmd-show-environment.c
index ad9e9e37..54baafe4 100644
--- a/cmd-show-environment.c
+++ b/cmd-show-environment.c
@@ -94,7 +94,7 @@ cmd_show_environment_exec(struct cmd *self, struct cmd_q *cmdq)
struct environ *env;
struct environ_entry *envent;
- if (args_has(self->args, 'g'))
+ if (args_has(self->args, 'g') || cmdq->state.tflag.s == NULL)
env = global_environ;
else
env = cmdq->state.tflag.s->environ;