From 59f80c9e4f7ede4be4d4282f245b5d10d0ef2371 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 27 Mar 2014 22:30:33 +0000 Subject: [PATCH] Handle bodies not ending in newlines w/EL_REFRESH The issue is that sofia siptrace output doesn't end each line with a newline. Instead it sends a separate newline afterward, which comes in as a separate event body. With the new EL_REFRESH code in effect the line is being cleared after the siptrace output has been written but before that next newline comes in. With our own refresh code this doesn't happen because of slight differences in where the stdio buffers get flushed compared to where the output of clear_line() ends up. This is a bit of a clumsy workaround. But we'll fix it first, then refactor. --- libs/esl/fs_cli.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index 4a2c0a8c62..121524771c 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -775,7 +775,19 @@ static void *msg_thread_run(esl_thread_t *me, void *obj) if (global_profile->log_uuid && !esl_strlen_zero(userdata)) { printf("%s ", userdata); } +#if HAVE_DECL_EL_REFRESH + if (strcmp("\n",handle->last_event->body)) { + char *c = handle->last_event->body; + printf("%s", handle->last_event->body); + if (*c) { + while (*c) ++c; c--; + if (*c != '\n') + printf("\n"); + } + } +#else printf("%s", handle->last_event->body); +#endif if(!(global_profile->batch_mode)) { if (!feature_level) printf("%s", ESL_SEQ_DEFAULT_COLOR); }