aboutsummaryrefslogtreecommitdiffstats
path: root/main/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c
index b9afbd89b..3d529cb86 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1378,8 +1378,10 @@ static struct ast_cli_entry *find_cli(char *const cmds[], int match_type)
continue;
/* we are in case match_type == -1 and mismatch on last word */
}
- if (cand == NULL || y > matchlen) /* remember the candidate */
+ if (y > matchlen) { /* remember the candidate */
+ matchlen = y;
cand = e;
+ }
}
return e ? e : cand;
}