diff options
author | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-14 22:03:59 +0000 |
---|---|---|
committer | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-14 22:03:59 +0000 |
commit | 295d4e10eb7e77f2c3400787eb7f225f2152570b (patch) | |
tree | fba7c602a2c620cc746997fdf99983f7bff614e9 /pbx | |
parent | 8dd5eb3e0fd1b9a658aa9ffcbb4c274cba88801a (diff) |
Cleanup formatting
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3211 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-x | pbx/pbx_config.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 47a4c9638..7f9027dc8 100755 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -100,24 +100,22 @@ static char reload_extensions_help[] = /* * Static code */ -static char* process_quotes_and_slashes( char* start, char find, char replace_with ) +static char *process_quotes_and_slashes(char* start, char find, char replace_with) { - char* dataPut = start; - int inEscape = 0; - int inQuotes = 0; - for( ; *start; start++ ) { - if( inEscape ) { + char *dataPut = start; + int inEscape = 0; + int inQuotes = 0; + + for (; *start; start++) { + if (inEscape) { *dataPut++ = *start; /* Always goes verbatim */ inEscape = 0; - } - else { - if( *start == '\\' ) { + } else { + if (*start == '\\') { inEscape = 1; /* Do not copy \ into the data */ - } - else if( *start == '\"' ) { + } else if (*start == '\"') { inQuotes = 1-inQuotes; /* Do not copy " into the data */ - } - else { + } else { /* Replace , with |, unless in quotes */ *dataPut++ = inQuotes ? *start : ((*start==find) ? replace_with : *start); } @@ -1170,18 +1168,18 @@ static int handle_context_add_extension(int fd, int argc, char *argv[]) } } } - app = strsep(&whole_exten,","); + app = strsep(&whole_exten, ","); if (app && (start = strchr(app, '(')) && (end = strrchr(app, ')'))) { *start = *end = '\0'; app_data = start + 1; - process_quotes_and_slashes(app_data,',','|'); + process_quotes_and_slashes(app_data, ',', '|'); } else - app_data = whole_exten; + app_data = whole_exten; if (!exten || !prior || !app || (!app_data && iprior != PRIORITY_HINT)) return RESULT_SHOWUSAGE; if (!app_data) - app_data=""; + app_data=""; if (ast_add_extension(argv[4], argc == 6 ? 1 : 0, exten, iprior, cidmatch, app, (void *)strdup(app_data), free, registrar)) { switch (errno) { |