From e68d7d0b0b3ce5624aa476fd1a9f00f625045b67 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 21 May 2008 18:52:07 +0000 Subject: [PATCH] merge main/asterisk.c portion of 117519 git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.20.1@117528 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/asterisk.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/asterisk.c b/main/asterisk.c index ef6c64de67..e11ee26581 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -2347,6 +2347,14 @@ static void ast_remotecontrol(char * data) if (ebuf[strlen(ebuf)-1] == '\n') ebuf[strlen(ebuf)-1] = '\0'; if (!remoteconsolehandler(ebuf)) { + /* Strip preamble from output */ + char *tmp; + for (tmp = ebuf; *tmp; tmp++) { + if (*tmp == 127) { + memmove(tmp, tmp + 1, strlen(tmp)); + tmp--; + } + } res = write(ast_consock, ebuf, strlen(ebuf) + 1); if (res < 1) { ast_log(LOG_WARNING, "Unable to write: %s\n", strerror(errno));