diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-01-18 22:17:31 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-01-18 22:17:31 +0000 |
commit | 6f71e1178e5e9efb90f66cf0d558ab226d2f93a7 (patch) | |
tree | 84b53711ba03f3f8d0b61dcace4eca78f6ef8127 /pbx/pbx_config.c | |
parent | d57bc8a513f1371150a8e6b4a5c80bae88708c3f (diff) |
constify arguments in more places where strings should not be modified (issue #6286)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx/pbx_config.c')
-rw-r--r-- | pbx/pbx_config.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 7991c96db..51947169b 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -143,7 +143,7 @@ static int handle_context_dont_include(int fd, int argc, char *argv[]) return RESULT_FAILURE; } -static char *complete_context_dont_include(char *line, char *word, +static char *complete_context_dont_include(const char *line, const char *word, int pos, int state) { int which = 0; @@ -449,7 +449,7 @@ static int handle_context_remove_extension(int fd, int argc, char *argv[]) * It's ugly, I know, but I'm waiting for Mark suggestion if upper is * bug or feature ... */ -static int fix_complete_args(char *line, char **word, int *pos) +static int fix_complete_args(const char *line, char **word, int *pos) { char *_line, *_strsep_line, *_previous_word = NULL, *_word = NULL; int words = 0; @@ -481,13 +481,14 @@ static int fix_complete_args(char *line, char **word, int *pos) } #endif /* BROKEN_READLINE */ -static char *complete_context_remove_extension(char *line, char *word, int pos, +static char *complete_context_remove_extension(const char *line, const char *word2, int pos, int state) { char *ret = NULL; int which = 0; #ifdef BROKEN_READLINE + char *word = (char *)word2; /* fool the compiler. XXX will go away later */ /* * Fix arguments, *word is a new allocated structure, REMEMBER to * free *word when you want to return from this function ... @@ -496,6 +497,8 @@ static char *complete_context_remove_extension(char *line, char *word, int pos, ast_log(LOG_ERROR, "Out of free memory\n"); return NULL; } +#else + const char *word = word2; #endif /* @@ -745,7 +748,7 @@ static int handle_context_add_include(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } -static char *complete_context_add_include(char *line, char *word, int pos, +static char *complete_context_add_include(const char *line, const char *word, int pos, int state) { struct ast_context *c; @@ -1243,7 +1246,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[]) } /*! add extension 6123,1,Dial,IAX/212.71.138.13/6123 into local */ -static char *complete_context_add_extension(char *line, char *word, +static char *complete_context_add_extension(const char *line, const char *word, int pos, int state) { int which = 0; @@ -1326,7 +1329,7 @@ static int handle_context_add_ignorepat(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } -static char *complete_context_add_ignorepat(char *line, char *word, +static char *complete_context_add_ignorepat(const char *line, const char *word, int pos, int state) { if (pos == 3) return state == 0 ? strdup("into") : NULL; @@ -1427,7 +1430,7 @@ static int handle_reload_extensions(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } -static char *complete_context_remove_ignorepat(char *line, char *word, +static char *complete_context_remove_ignorepat(const char *line, const char *word, int pos, int state) { struct ast_context *c; |