aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_oss.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-28 23:33:02 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-28 23:33:02 +0000
commit9050284feaad274eb5a5057995d396ff56491ed3 (patch)
tree365efb88bff7bdab308366abfe1e55ac65907974 /channels/chan_oss.c
parent5004f1cb9d2ff2b7874867150eae2c4f04772505 (diff)
another batch of cli simplifications
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@15857 f38db490-d61c-443f-a65b-d21fe96a405b
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[] =