fix new util function to actually do what it says it will

This commit is contained in:
Anthony Minessale 2010-07-02 13:00:29 -05:00
parent 6c7970f969
commit a7d8f866fd
1 changed files with 6 additions and 6 deletions

View File

@ -105,16 +105,18 @@ static inline char *switch_strchr_strict(const char *in, char find, const char *
while(p && *p) {
const char *a = allowed;
int found = 0;
int acceptable = 0;
if (*p == find) break;
if (!a) {
found = 1;
acceptable = 1;
} else {
while(a && *a) {
if (*p == *a) {
found = 1;
acceptable = 1;
break;
}
@ -123,9 +125,7 @@ static inline char *switch_strchr_strict(const char *in, char find, const char *
}
if (!found) return NULL;
if (*p == find) break;
if (!acceptable) return NULL;
p++;
}