summaryrefslogtreecommitdiff
path: root/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli.c')
-rwxr-xr-xcli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index d7ebcc758..ef1810d2d 100755
--- a/cli.c
+++ b/cli.c
@@ -801,7 +801,7 @@ static char *__ast_cli_generator(char *text, char *word, int state, int lock)
matchnum++;
if (matchnum > state) {
/* Now, what we're supposed to return is the next word... */
- if (strlen(word)) {
+ if (strlen(word) && x>0) {
res = e->cmda[x-1];
} else {
res = e->cmda[x];