=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/format.c,v retrieving revision 1.288 retrieving revision 1.289 diff -c -r1.288 -r1.289 *** src/usr.bin/tmux/format.c 2021/07/13 22:09:29 1.288 --- src/usr.bin/tmux/format.c 2021/08/12 08:05:11 1.289 *************** *** 1,4 **** ! /* $OpenBSD: format.c,v 1.288 2021/07/13 22:09:29 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: format.c,v 1.289 2021/08/12 08:05:11 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott *************** *** 929,934 **** --- 929,937 ---- struct window_pane *wp = ft->wp; struct grid_cell gc; + if (wp == NULL) + return (NULL); + tty_default_colours(&gc, wp); return (xstrdup(colour_tostring(gc.fg))); } *************** *** 940,945 **** --- 943,951 ---- struct window_pane *wp = ft->wp; struct grid_cell gc; + if (wp == NULL) + return (NULL); + tty_default_colours(&gc, wp); return (xstrdup(colour_tostring(gc.bg))); } *************** *** 3077,3082 **** --- 3083,3104 ---- if (ft->client != NULL) server_client_unref(ft->client); free(ft); + } + + /* Log each format. */ + static void + format_log_debug_cb(const char *key, const char *value, void *arg) + { + const char *prefix = arg; + + log_debug("%s: %s=%s", prefix, key, value); + } + + /* Log a format tree. */ + void + format_log_debug(struct format_tree *ft, const char *prefix) + { + format_each(ft, format_log_debug_cb, prefix); } /* Walk each format. */