mirror of
https://gitlab.com/klmp200/fish.git
synced 2024-12-22 15:51:09 +00:00
string regex comparator with "?"
This commit is contained in:
parent
32a485860a
commit
3a87b110b6
@ -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