aboutsummaryrefslogtreecommitdiffstats
path: root/main/pbx.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-20 23:31:08 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-20 23:31:08 +0000
commitf718745448f9811c563e51a4096b8ba1831d8c3e (patch)
tree3f50da7e5bf1f42f4eb056f19985332b946766d0 /main/pbx.c
parent764df684267586ca22f77def6bc31f073e1487ee (diff)
Fix trunk brokenness; also, optimize application registration
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@70610 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/pbx.c b/main/pbx.c
index dba568a45..471c1c3d2 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2940,15 +2940,16 @@ int ast_register_application(const char *app, int (*execute)(struct ast_channel
{
struct ast_app *tmp, *cur = NULL;
char tmps[80];
- int length;
+ int length, res;
AST_RWLIST_WRLOCK(&apps);
AST_RWLIST_TRAVERSE(&apps, tmp, list) {
- if (!strcasecmp(app, tmp->name)) {
+ if (!(res = strcasecmp(app, tmp->name))) {
ast_log(LOG_WARNING, "Already have an application '%s'\n", app);
AST_RWLIST_UNLOCK(&apps);
return -1;
- }
+ } else if (res < 0)
+ break;
}
length = sizeof(*tmp) + strlen(app) + 1;