mirror of
https://gitlab.com/klmp200/fish.git
synced 2024-11-14 04:43:20 +00:00
string regex comparator with "?"
This commit is contained in:
parent
fa6964d421
commit
03dc8cf4ba
@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user