aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-21 14:01:19 +0000
committernicm <nicm>2017-04-21 14:01:19 +0000
commitbba588752f8085da13edcacd71101055bd617303 (patch)
treeb75e32cccebefb24cda475bed163f613a2994548 /format.c
parent311dad8c28c8c1a842beb3dbb1757064b9d83b2e (diff)
downloadrtmux-bba588752f8085da13edcacd71101055bd617303.tar.gz
rtmux-bba588752f8085da13edcacd71101055bd617303.tar.bz2
rtmux-bba588752f8085da13edcacd71101055bd617303.zip
Store state shared between multiple commands in the queue in a shared
structure.
Diffstat (limited to 'format.c')
-rw-r--r--format.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/format.c b/format.c
index b173df4c..4f5d4b9c 100644
--- a/format.c
+++ b/format.c
@@ -554,10 +554,12 @@ format_create(struct cmdq_item *item, int tag, int flags)
format_add(ft, "socket_path", "%s", socket_path);
format_add_tv(ft, "start_time", &start_time);
- if (item != NULL && item->cmd != NULL)
- format_add(ft, "command", "%s", item->cmd->entry->name);
- if (item != NULL && item->formats != NULL)
- format_merge(ft, item->formats);
+ if (item != NULL) {
+ if (item->cmd != NULL)
+ format_add(ft, "command", "%s", item->cmd->entry->name);
+ if (item->shared != NULL && item->shared->formats != NULL)
+ format_merge(ft, item->shared->formats);
+ }
return (ft);
}