mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Remove leading spaces from the CLI command before parsing
If you've mistakenly put a space before typing in a command, the leading space will be included as part of the command, and the command parser will not find the corresponding command. This patch rectifies that situation by stripping the leading spaces on commands. Review: https://reviewboard.asterisk.org/r/2709/ Patch-by: Tilghman Lesher ........ Merged revisions 396745 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396746 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2112,6 +2112,11 @@ static int remoteconsolehandler(char *s)
|
||||
/* Called when readline data is available */
|
||||
if (!ast_all_zeros(s))
|
||||
ast_el_add_history(s);
|
||||
|
||||
while (isspace(*s)) {
|
||||
s++;
|
||||
}
|
||||
|
||||
/* The real handler for bang */
|
||||
if (s[0] == '!') {
|
||||
if (s[1])
|
||||
|
Reference in New Issue
Block a user