From cbe31981b327d6348171be2abbf94dfb68150657 Mon Sep 17 00:00:00 2001 From: o9000 Date: Tue, 27 Jun 2017 12:42:51 +0200 Subject: [PATCH] Executor: fallback to old style tooltips if stderr is empty --- src/execplugin/execplugin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/execplugin/execplugin.c b/src/execplugin/execplugin.c index e2d221f..5059827 100644 --- a/src/execplugin/execplugin.c +++ b/src/execplugin/execplugin.c @@ -794,10 +794,12 @@ gboolean read_execp(void *obj) start += strlen(ansi_clear_screen); else start = execp->backend->buf_stderr; - execp->backend->tooltip = strdup(start); - rstrip(execp->backend->tooltip); - if (strlen(execp->backend->tooltip) > MAX_TOOLTIP_LEN) - execp->backend->tooltip[MAX_TOOLTIP_LEN] = '\0'; + if (*start) { + execp->backend->tooltip = strdup(start); + rstrip(execp->backend->tooltip); + if (strlen(execp->backend->tooltip) > MAX_TOOLTIP_LEN) + execp->backend->tooltip[MAX_TOOLTIP_LEN] = '\0'; + } } execp->backend->buf_stderr_length = 0; execp->backend->buf_stderr[execp->backend->buf_stderr_length] = '\0';