mirror of
https://github.com/tmux/tmux.git
synced 2025-03-13 21:58:48 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
0aa6c6f647
7
format.c
7
format.c
@ -1166,12 +1166,12 @@ format_each(struct format_tree *ft, void (*cb)(const char *, const char *,
|
|||||||
void *), void *arg)
|
void *), void *arg)
|
||||||
{
|
{
|
||||||
struct format_entry *fe;
|
struct format_entry *fe;
|
||||||
static char s[64];
|
char s[64];
|
||||||
|
|
||||||
RB_FOREACH(fe, format_entry_tree, &ft->tree) {
|
RB_FOREACH(fe, format_entry_tree, &ft->tree) {
|
||||||
if (fe->t != 0) {
|
if (fe->t != 0) {
|
||||||
xsnprintf(s, sizeof s, "%lld", (long long)fe->t);
|
xsnprintf(s, sizeof s, "%lld", (long long)fe->t);
|
||||||
cb(fe->key, fe->value, s);
|
cb(fe->key, s, arg);
|
||||||
} else {
|
} else {
|
||||||
if (fe->value == NULL && fe->cb != NULL) {
|
if (fe->value == NULL && fe->cb != NULL) {
|
||||||
fe->cb(ft, fe);
|
fe->cb(ft, fe);
|
||||||
@ -1214,8 +1214,7 @@ format_add(struct format_tree *ft, const char *key, const char *fmt, ...)
|
|||||||
static void
|
static void
|
||||||
format_add_tv(struct format_tree *ft, const char *key, struct timeval *tv)
|
format_add_tv(struct format_tree *ft, const char *key, struct timeval *tv)
|
||||||
{
|
{
|
||||||
struct format_entry *fe;
|
struct format_entry *fe, *fe_now;
|
||||||
struct format_entry *fe_now;
|
|
||||||
|
|
||||||
fe = xmalloc(sizeof *fe);
|
fe = xmalloc(sizeof *fe);
|
||||||
fe->key = xstrdup(key);
|
fe->key = xstrdup(key);
|
||||||
|
Loading…
Reference in New Issue
Block a user