diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-22 18:53:53 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-22 18:53:53 +0000 |
commit | eccea1d34ddf41917648ef846639fa066ba656c6 (patch) | |
tree | 0277eea9897edee17db49ebde54d005f8da034d9 /main | |
parent | 60aac5a152aa210041939ad80a77bad4946c6b8c (diff) |
Also remove preamble from asynchronous events (reported by jsmith on #asterisk-dev)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@117899 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-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 e11ee2658..b66b8dd9f 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1765,6 +1765,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) { @@ -1798,6 +1799,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); |