Fix 'remove extension' completion
authorJames Golovich <james@gnuinter.net>
Sat, 1 May 2004 05:50:51 +0000 (05:50 +0000)
committerJames Golovich <james@gnuinter.net>
Sat, 1 May 2004 05:50:51 +0000 (05:50 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2838 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx/pbx_config.c

index be87fff..d882863 100755 (executable)
@@ -526,17 +526,15 @@ static char *complete_context_remove_extension(char *line, char *word, int pos,
                                                 (exten && !strncmp(ast_get_extension_name(e), exten,
                                                                    strlen(exten))) ) { /* if input, compare ... */
                                                if (++which > state) {
-                                                       /* is there some context input? if not, throw back
-                                                        * exten@context, if yes throw back only context ...
+                                                       /* If there is an extension then return
+                                                        * exten@context.
                                                         */
-                                                       if (!context) {
+                                                       if (exten) {
                                                                ret = malloc(strlen(ast_get_extension_name(e)) +
                                                                        strlen(ast_get_context_name(c)) + 2);
                                                                if (ret)
                                                                        sprintf(ret, "%s@%s", ast_get_extension_name(e),
                                                                                ast_get_context_name(c));
-                                                       } else {
-                                                               ret = strdup(ast_get_context_name(c));
                                                        }
                                                        free(exten); free(context);