aboutsummaryrefslogtreecommitdiffstats
path: root/main/cli.c
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-10 20:23:50 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-10 20:23:50 +0000
commit9ae91f799ab15938b69b072b681fb606286d08ea (patch)
treeb55253e4a6cb86147db48091cca0af756faf2ed4 /main/cli.c
parent8cb986b936ea0cee5af2dccf467fe1fc5b89414b (diff)
Another batch of files from RSW. The remaining apps and a few more
files from main/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137089 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/main/cli.c b/main/cli.c
index 377e1f01a..8459ea35d 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1625,7 +1625,7 @@ static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
static char *parse_args(const char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
{
- char *dup, *cur;
+ char *duplicate, *cur;
int x = 0;
int quoted = 0;
int escaped = 0;
@@ -1638,10 +1638,10 @@ static char *parse_args(const char *s, int *argc, char *argv[], int max, int *tr
if (s == NULL) /* invalid, though! */
return NULL;
/* make a copy to store the parsed string */
- if (!(dup = ast_strdup(s)))
+ if (!(duplicate = ast_strdup(s)))
return NULL;
- cur = dup;
+ cur = duplicate;
/* scan the original string copying into cur when needed */
for (; *s ; s++) {
if (x >= max - 1) {
@@ -1685,7 +1685,7 @@ static char *parse_args(const char *s, int *argc, char *argv[], int max, int *tr
argv[x] = NULL;
*argc = x;
*trailingwhitespace = whitespace;
- return dup;
+ return duplicate;
}
/*! \brief Return the number of unique matches for the generator */
@@ -1777,9 +1777,9 @@ static char *__ast_cli_generator(const char *text, const char *word, int state,
char matchstr[80] = "";
int tws = 0;
/* Split the argument into an array of words */
- char *dup = parse_args(text, &x, argv, ARRAY_LEN(argv), &tws);
+ char *duplicate = parse_args(text, &x, argv, ARRAY_LEN(argv), &tws);
- if (!dup) /* malloc error */
+ if (!duplicate) /* malloc error */
return NULL;
/* Compute the index of the last argument (could be an empty string) */
@@ -1844,7 +1844,7 @@ static char *__ast_cli_generator(const char *text, const char *word, int state,
}
if (lock)
AST_RWLIST_UNLOCK(&helpers);
- ast_free(dup);
+ ast_free(duplicate);
return ret;
}
@@ -1858,12 +1858,12 @@ int ast_cli_command(int fd, const char *s)
char *args[AST_MAX_ARGS + 1];
struct ast_cli_entry *e;
int x;
- char *dup = parse_args(s, &x, args + 1, AST_MAX_ARGS, NULL);
+ char *duplicate = parse_args(s, &x, args + 1, AST_MAX_ARGS, NULL);
char *retval = NULL;
struct ast_cli_args a = {
.fd = fd, .argc = x, .argv = args+1 };
- if (dup == NULL)
+ if (duplicate == NULL)
return -1;
if (x < 1) /* We need at least one entry, otherwise ignore */
@@ -1904,7 +1904,7 @@ int ast_cli_command(int fd, const char *s)
}
ast_atomic_fetchadd_int(&e->inuse, -1);
done:
- ast_free(dup);
+ ast_free(duplicate);
return 0;
}