1
0
mirror of https://gitlab.com/klmp200/fish.git synced 2024-11-22 00:33:20 +00:00

All hail Britania !

This commit is contained in:
Aethor 2017-06-13 11:13:06 +02:00
parent 10234a6b72
commit f3d5fdda21

View File

@ -250,7 +250,7 @@ WordList* getFiles(char* path, char* wildcardedString){
while((dir = readdir(directory)) != NULL){ while((dir = readdir(directory)) != NULL){
if(strcmp(dir->d_name, ".") && strcmp(dir->d_name, "..") && wildcardedStringMatches(wildcardedString, dir->d_name)){//sorry strcmp but I dont like you :( if(wildcardedString != NULL && dir->d_name != NULL && strcmp(dir->d_name, ".") && strcmp(dir->d_name, "..") && wildcardedStringMatches(wildcardedString, dir->d_name)){//sorry strcmp but I dont like you :(
char* filePath = trueStrcat(path, dir->d_name); char* filePath = trueStrcat(path, dir->d_name);
addEndWordList(files, filePath); addEndWordList(files, filePath);
@ -284,12 +284,16 @@ int wildcardedStringMatches(char* string1, char* string2){//TODO
tempIChar = string1[i+1]; tempIChar = string1[i+1];
if(tempIChar == '\0'){
return 1;
}
while(string2[j] != tempIChar){ while(string2[j] != tempIChar){
j++; j++;
if(string2[j] == '\0' && tempIChar == '\0'){ if(string2[j] == '\0'){
return 1; return 0;
} }
} }