mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-20 03:59:01 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@47672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1378,9 +1378,11 @@ static struct ast_cli_entry *find_cli(char *const cmds[], int match_type)
|
|||||||
continue;
|
continue;
|
||||||
/* we are in case match_type == -1 and mismatch on last word */
|
/* 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;
|
cand = e;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return e ? e : cand;
|
return e ? e : cand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user