diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-22 18:55:20 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-22 18:55:20 +0000 |
commit | 155b04bab807afbe643d79f6c6c42d53810b84e0 (patch) | |
tree | 4d415331476264e1e4a542844f4b5f45a2e7a538 /main/asterisk.c | |
parent | b6190944573b1a28eb6220a906989cf2487ef725 (diff) |
Merged revisions 117900 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r117900 | tilghman | 2008-05-22 13:54:41 -0500 (Thu, 22 May 2008) | 10 lines
Merged revisions 117899 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r117899 | tilghman | 2008-05-22 13:53:53 -0500 (Thu, 22 May 2008) | 2 lines
Also remove preamble from asynchronous events (reported by jsmith on #asterisk-dev)
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@117901 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r-- | main/asterisk.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index d6e2da013..4355cdf44 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1907,6 +1907,7 @@ static int ast_el_read_char(EditLine *el, char *cp) return (num_read); } if (fds[0].revents) { + char *tmp; res = read(ast_consock, buf, sizeof(buf) - 1); /* if the remote side disappears exit */ if (res < 1) { @@ -1939,6 +1940,14 @@ static int ast_el_read_char(EditLine *el, char *cp) buf[res] = '\0'; + /* Strip preamble from asynchronous events, too */ + for (tmp = buf; *tmp; tmp++) { + if (*tmp == 127) { + memmove(tmp, tmp + 1, strlen(tmp)); + tmp--; + } + } + /* Write over the CLI prompt */ if (!ast_opt_exec && !lastpos) write(STDOUT_FILENO, "\r", 1); |