diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-21 22:52:20 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-21 22:52:20 +0000 |
commit | 9cac9bf42ac6584290aabeaa5e531179092d94b2 (patch) | |
tree | 1979125b53990fa10f37ea4099e66c4931554805 /main/cli.c | |
parent | b9476db2f96d5e832b2ffe400e8cec10ac7e3faa (diff) |
Merged revisions 85532 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r85532 | russell | 2007-10-13 00:24:33 -0500 (Sat, 13 Oct 2007) | 8 lines
Properly handle the case where read() may return the text for more than one
CLI command at once for a remote console.
(closes issue #10888)
Reported by: jamesgolovich
Patches:
asterisk-climultiple.diff.txt uploaded by jamesgolovich (license 176)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86585 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/main/cli.c b/main/cli.c index 432869c1a..06c1b9ca2 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1850,3 +1850,20 @@ done: ast_free(dup); return 0; } + +int ast_cli_command_multiple(int fd, size_t size, const char *s) +{ + char cmd[512]; + int x, y = 0, count = 0; + + for (x = 0; x < size; x++) { + cmd[y] = s[x]; + y++; + if (s[x] == '\0') { + ast_cli_command(fd, cmd); + y = 0; + count++; + } + } + return count; +} |