aboutsummaryrefslogtreecommitdiffstats
path: root/main/config.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-07 21:12:33 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-07 21:12:33 +0000
commitd6c121d04e5899d1a4f767cf954a9cdc0f320c31 (patch)
treee2c834bd35732203dc1c3e6bba9acc5930557cd5 /main/config.c
parenta2bf8b4a4672ba87ebcbed314f2b2053db3ab176 (diff)
Display a message if no config mappings are found with "core show config mappings".
Closes issue #11704, patch by kshumard. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@96936 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/config.c')
-rw-r--r--main/config.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/main/config.c b/main/config.c
index 4359bcf88..d5b0738fc 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2249,16 +2249,21 @@ static char *handle_cli_core_show_config_mappings(struct ast_cli_entry *e, int c
ast_mutex_lock(&config_lock);
- ast_cli(a->fd, "\n\n");
- for (eng = config_engine_list; eng; eng = eng->next) {
- ast_cli(a->fd, "\nConfig Engine: %s\n", eng->name);
- for (map = config_maps; map; map = map->next)
- if (!strcasecmp(map->driver, eng->name)) {
- ast_cli(a->fd, "===> %s (db=%s, table=%s)\n", map->name, map->database,
- map->table ? map->table : map->name);
+ if (!config_engine_list) {
+ ast_cli(a->fd, "No config mappings found.\n");
+ } else {
+ ast_cli(a->fd, "\n\n");
+ for (eng = config_engine_list; eng; eng = eng->next) {
+ ast_cli(a->fd, "\nConfig Engine: %s\n", eng->name);
+ for (map = config_maps; map; map = map->next) {
+ if (!strcasecmp(map->driver, eng->name)) {
+ ast_cli(a->fd, "===> %s (db=%s, table=%s)\n", map->name, map->database,
+ map->table ? map->table : map->name);
+ }
}
+ }
+ ast_cli(a->fd,"\n\n");
}
- ast_cli(a->fd,"\n\n");
ast_mutex_unlock(&config_lock);