mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Fix initialization of CLI (bug #2861)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
15
cli.c
15
cli.c
@@ -936,10 +936,10 @@ int ast_cli_register(struct ast_cli_entry *e)
|
|||||||
|
|
||||||
static int help_workhorse(int fd, char *match[])
|
static int help_workhorse(int fd, char *match[])
|
||||||
{
|
{
|
||||||
char fullcmd1[80];
|
char fullcmd1[80] = "";
|
||||||
char fullcmd2[80];
|
char fullcmd2[80] = "";
|
||||||
char matchstr[80];
|
char matchstr[80];
|
||||||
char *fullcmd;
|
char *fullcmd = NULL;
|
||||||
struct ast_cli_entry *e, *e1, *e2;
|
struct ast_cli_entry *e, *e1, *e2;
|
||||||
e1 = builtins;
|
e1 = builtins;
|
||||||
e2 = helpers;
|
e2 = helpers;
|
||||||
@@ -1072,8 +1072,7 @@ normal:
|
|||||||
int ast_cli_generatornummatches(char *text, char *word)
|
int ast_cli_generatornummatches(char *text, char *word)
|
||||||
{
|
{
|
||||||
int matches = 0, i = 0;
|
int matches = 0, i = 0;
|
||||||
char *buf, *oldbuf = NULL;
|
char *buf = NULL, *oldbuf = NULL;
|
||||||
|
|
||||||
|
|
||||||
while ( (buf = ast_cli_generator(text, word, i)) ) {
|
while ( (buf = ast_cli_generator(text, word, i)) ) {
|
||||||
if (++i > 1 && strcmp(buf,oldbuf) == 0) {
|
if (++i > 1 && strcmp(buf,oldbuf) == 0) {
|
||||||
@@ -1132,10 +1131,10 @@ static char *__ast_cli_generator(char *text, char *word, int state, int lock)
|
|||||||
int x;
|
int x;
|
||||||
int matchnum=0;
|
int matchnum=0;
|
||||||
char *dup, *res;
|
char *dup, *res;
|
||||||
char fullcmd1[80];
|
char fullcmd1[80] = "";
|
||||||
char fullcmd2[80];
|
char fullcmd2[80] = "";
|
||||||
char matchstr[80];
|
char matchstr[80];
|
||||||
char *fullcmd;
|
char *fullcmd = NULL;
|
||||||
|
|
||||||
if ((dup = parse_args(text, &x, argv))) {
|
if ((dup = parse_args(text, &x, argv))) {
|
||||||
join(matchstr, sizeof(matchstr), argv);
|
join(matchstr, sizeof(matchstr), argv);
|
||||||
|
Reference in New Issue
Block a user