mirror of
https://gitlab.com/klmp200/fish.git
synced 2024-11-22 00:33:20 +00:00
Merge branch 'bro' into 'master'
All hail Britania ! See merge request !17
This commit is contained in:
commit
4f6dcd2b4a
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user