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

Merge branch 'bro' into 'master'

All hail Britania !

See merge request !17
This commit is contained in:
Antoine Bartuccio 2017-06-13 09:16:10 +00:00
commit 4f6dcd2b4a

View File

@ -250,7 +250,7 @@ WordList* getFiles(char* path, char* wildcardedString){
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);
addEndWordList(files, filePath);
@ -284,12 +284,16 @@ int wildcardedStringMatches(char* string1, char* string2){//TODO
tempIChar = string1[i+1];
if(tempIChar == '\0'){
return 1;
}
while(string2[j] != tempIChar){
j++;
if(string2[j] == '\0' && tempIChar == '\0'){
return 1;
if(string2[j] == '\0'){
return 0;
}
}