Strip the preamble from the output also when -rx is not being used

(Related to issue #12702)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-05-21 18:40:14 +00:00
parent 67634386e9
commit 0b0f6a1a58
2 changed files with 20 additions and 3 deletions

View File

@@ -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));