diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-15 17:46:45 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-15 17:46:45 +0000 |
commit | a3817c97963d246eaa3ea21739626bab6010a7d6 (patch) | |
tree | 0edbeb6336dff2f14d3b7f000263d952130f6616 /main | |
parent | a1dee5b64d32fa4e758abf22466fe5613d56561f (diff) |
fix longest match search in find_cli.
Trunk already fixed.
1.2 not affected (well, i have no idea, the code is totally
different there).
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47672 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/cli.c | 4 |
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; } |