version 1.122, 2017/02/09 15:04:53 |
version 1.123, 2017/03/08 13:36:12 |
|
|
if (fe->value != NULL) |
if (fe->value != NULL) |
format_add(ft, fe->key, "%s", fe->value); |
format_add(ft, fe->key, "%s", fe->value); |
} |
} |
|
|
} |
} |
|
|
/* Create a new tree. */ |
/* Create a new tree. */ |
|
|
|
|
log_debug("format '%s' -> '%s'", saved, buf); |
log_debug("format '%s' -> '%s'", saved, buf); |
return (buf); |
return (buf); |
|
} |
|
|
|
/* Expand a single string. */ |
|
char * |
|
format_single(struct cmdq_item *item, const char *fmt, struct client *c, |
|
struct session *s, struct winlink *wl, struct window_pane *wp) |
|
{ |
|
struct format_tree *ft; |
|
char *expanded; |
|
|
|
ft = format_create(item, FORMAT_NONE, 0); |
|
format_defaults(ft, c, s, wl, wp); |
|
|
|
expanded = format_expand(ft, fmt); |
|
format_free(ft); |
|
return (expanded); |
} |
} |
|
|
/* Set defaults for any of arguments that are not NULL. */ |
/* Set defaults for any of arguments that are not NULL. */ |