summaryrefslogtreecommitdiff
path: root/channels/chan_oss.c
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2006-03-28 23:33:02 +0000
committerLuigi Rizzo <rizzo@icir.org>2006-03-28 23:33:02 +0000
commit096bf1511fe1e53b3ca10ffcd4e1b994ade7bca8 (patch)
tree365efb88bff7bdab308366abfe1e55ac65907974 /channels/chan_oss.c
parentb94f6a6df415836923a7d7abf377021cc9903e03 (diff)
another batch of cli simplifications
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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[] =