diff options
author | Thomas Adam <thomas@xteddy.org> | 2015-05-30 02:01:18 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2015-05-30 02:01:18 +0100 |
commit | c39dfb17aeda95bb4bfbeae483d2601952fd8828 (patch) | |
tree | 1d187c23f0a1e108045bb6eef3b4cc086626db1d /format.c | |
parent | beffdf6575454f5f99ed45222cdef6dbea65ec58 (diff) | |
parent | 2a8c2648f0375994715b2fea9de144b15c9588a2 (diff) | |
download | rtmux-c39dfb17aeda95bb4bfbeae483d2601952fd8828.tar.gz rtmux-c39dfb17aeda95bb4bfbeae483d2601952fd8828.tar.bz2 rtmux-c39dfb17aeda95bb4bfbeae483d2601952fd8828.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 19 |
1 files changed, 6 insertions, 13 deletions
@@ -176,17 +176,6 @@ format_job_callback(struct job *job) fj->job = NULL; free(fj->out); - if (WIFEXITED(job->status) && WEXITSTATUS(job->status) != 0) { - xasprintf(&fj->out, "<'%s' exited with %d>", fj->cmd, - WEXITSTATUS(job->status)); - return; - } - if (WIFSIGNALED(job->status)) { - xasprintf(&fj->out, "<'%s' got signal %d>", fj->cmd, - WTERMSIG(job->status)); - return; - } - buf = NULL; if ((line = evbuffer_readline(job->event->input)) == NULL) { len = EVBUFFER_LENGTH(job->event->input); @@ -491,7 +480,7 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t) char * format_expand(struct format_tree *ft, const char *fmt) { - char *buf, *tmp; + char *buf, *tmp, *cmd; const char *ptr, *s; size_t off, len, n, slen; int ch, brackets; @@ -531,10 +520,14 @@ format_expand(struct format_tree *ft, const char *fmt) tmp = xmalloc(n + 1); memcpy(tmp, fmt, n); tmp[n] = '\0'; + cmd = format_expand(ft, tmp); - s = format_job_get(ft, tmp); + s = format_job_get(ft, cmd); slen = strlen(s); + free(cmd); + free(tmp); + while (len - off < slen + 1) { buf = xreallocarray(buf, 2, len); len *= 2; |