mirror of
https://github.com/tmux/tmux.git
synced 2024-11-18 02:18:53 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
5a44e18490
9
format.c
9
format.c
@ -1137,7 +1137,7 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t)
|
|||||||
char *
|
char *
|
||||||
format_expand(struct format_tree *ft, const char *fmt)
|
format_expand(struct format_tree *ft, const char *fmt)
|
||||||
{
|
{
|
||||||
char *buf, *out;
|
char *buf, *out, *name;
|
||||||
const char *ptr, *s, *saved = fmt;
|
const char *ptr, *s, *saved = fmt;
|
||||||
size_t off, len, n, outlen;
|
size_t off, len, n, outlen;
|
||||||
int ch, brackets;
|
int ch, brackets;
|
||||||
@ -1176,8 +1176,11 @@ format_expand(struct format_tree *ft, const char *fmt)
|
|||||||
|
|
||||||
if (ft->flags & FORMAT_NOJOBS)
|
if (ft->flags & FORMAT_NOJOBS)
|
||||||
out = xstrdup("");
|
out = xstrdup("");
|
||||||
else
|
else {
|
||||||
out = format_job_get(ft, xstrndup(fmt, n));
|
name = xstrndup(fmt, n);
|
||||||
|
out = format_job_get(ft, name);
|
||||||
|
free(name);
|
||||||
|
}
|
||||||
outlen = strlen(out);
|
outlen = strlen(out);
|
||||||
|
|
||||||
while (len - off < outlen + 1) {
|
while (len - off < outlen + 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user