fix new util function to actually do what it says it will
This commit is contained in:
parent
6c7970f969
commit
a7d8f866fd
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue