fix logic error; don't test for rtcache flag unless asked to (issue #6923)
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Apr 2006 22:07:52 +0000 (22:07 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Apr 2006 22:07:52 +0000 (22:07 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@19393 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index c2f5be3..c9ad6b1 100644 (file)
@@ -8502,7 +8502,7 @@ static char *complete_sip_peer(const char *word, int state, int flags2)
        ASTOBJ_CONTAINER_TRAVERSE(&peerl, !result, do {
                /* locking of the object is not required because only the name and flags are being compared */
                if (!strncasecmp(word, iterator->name, wordlen) &&
-                               ast_test_flag(&iterator->flags[1], flags2) &&
+                               (!flags2 || ast_test_flag(&iterator->flags[1], flags2)) &&
                                ++which > state)
                        result = ast_strdup(iterator->name);
        } while(0) );