diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-28 23:33:02 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-28 23:33:02 +0000 |
commit | 9050284feaad274eb5a5057995d396ff56491ed3 (patch) | |
tree | 365efb88bff7bdab308366abfe1e55ac65907974 /channels/chan_oss.c | |
parent | 5004f1cb9d2ff2b7874867150eae2c4f04772505 (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.c | 16 |
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[] = |