mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
add tab completion for 'core set debug X filename.c'
(closes issue #13969) Reported by: jtodd Patches: 20081205__bug13969.diff.txt uploaded by Corydon76 (license 14) Tested by: mvanbaak, eliel git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -319,6 +319,24 @@ void ast_unregister_file_version(const char *file)
|
||||
ast_free(find);
|
||||
}
|
||||
|
||||
char *ast_complete_source_filename(const char *partial, int n)
|
||||
{
|
||||
struct file_version *find;
|
||||
size_t len = strlen(partial);
|
||||
int count = 0;
|
||||
char *res = NULL;
|
||||
|
||||
AST_RWLIST_RDLOCK(&file_versions);
|
||||
AST_RWLIST_TRAVERSE(&file_versions, find, list) {
|
||||
if (!strncasecmp(find->file, partial, len) && ++count > n) {
|
||||
res = ast_strdup(find->file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
AST_RWLIST_UNLOCK(&file_versions);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*! \brief Find version for given module name */
|
||||
const char *ast_file_version_find(const char *file)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user