Don't use special strings if #() commands fail, just remove the format
authornicm <nicm@openbsd.org>
Fri, 29 May 2015 23:26:52 +0000 (23:26 +0000)
committernicm <nicm@openbsd.org>
Fri, 29 May 2015 23:26:52 +0000 (23:26 +0000)
(as if the command produced nothing). Makes constructions that can fail
like '#(test whatever && echo foo)' work as they did before.

usr.bin/tmux/format.c

index 9a8be29..6459e96 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.69 2015/05/29 23:12:38 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.70 2015/05/29 23:26:52 nicm Exp $ */
 
 /*
  * Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -175,17 +175,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);