summaryrefslogtreecommitdiff
path: root/channels/chan_oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_oss.c')
-rw-r--r--channels/chan_oss.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index f318cd631..89c3e3e36 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -1035,19 +1035,9 @@ static int console_autoanswer(int fd, int argc, char *argv[])
static char *autoanswer_complete(const char *line, const char *word, int pos, int state)
{
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return ast_strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return ast_strdup("off");
- default:
- return NULL;
- }
- return NULL;
+ static char *choices[] = { "on", "off", NULL };
+
+ return (pos != 1) ? NULL : ast_cli_complete(word, choices, state);
}
static char autoanswer_usage[] =