Cleanup formatting

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
James Golovich 22 years ago
parent 001623fa0a
commit bc80b3130d

@ -105,19 +105,17 @@ static char* process_quotes_and_slashes( char* start, char find, char replace_wi
char *dataPut = start; char *dataPut = start;
int inEscape = 0; int inEscape = 0;
int inQuotes = 0; int inQuotes = 0;
for (; *start; start++) { for (; *start; start++) {
if (inEscape) { if (inEscape) {
*dataPut++ = *start; /* Always goes verbatim */ *dataPut++ = *start; /* Always goes verbatim */
inEscape = 0; inEscape = 0;
} } else {
else {
if (*start == '\\') { if (*start == '\\') {
inEscape = 1; /* Do not copy \ into the data */ inEscape = 1; /* Do not copy \ into the data */
} } else if (*start == '\"') {
else if( *start == '\"' ) {
inQuotes = 1-inQuotes; /* Do not copy " into the data */ inQuotes = 1-inQuotes; /* Do not copy " into the data */
} } else {
else {
/* Replace , with |, unless in quotes */ /* Replace , with |, unless in quotes */
*dataPut++ = inQuotes ? *start : ((*start==find) ? replace_with : *start); *dataPut++ = inQuotes ? *start : ((*start==find) ? replace_with : *start);
} }

Loading…
Cancel
Save