string regex comparator with "?"

This commit is contained in:
Aethor 2017-05-15 15:03:36 +02:00
parent fa6964d421
commit 03dc8cf4ba
1 changed files with 37 additions and 1 deletions

View File

@ -59,7 +59,43 @@ WordArray * getFiles(char* path){
bool comparator(char* string1, char* string2){//TODO
return true;
int i = 0;
if(string1 != NULL && string2 != NULL){
while(string1[i] != '\0' && string2[i] != '\0'){
if(string1[i] != string2[i] && string1[i] != '?'){
return false;
}
i++;
}
if(string1[i] == '\0' && string2[i] == '\0'){
return true;
}
else{
return false;
}
}
else{
printf("warning : fuck you, strings are considered null");
crash();
return false;
}
}