Va mourir git

This commit is contained in:
Aethor 2017-06-02 17:53:45 +02:00
parent 04db376a0b
commit 0d00964ee9
1 changed files with 14 additions and 4 deletions

View File

@ -102,7 +102,10 @@ void recursiveExpandWord(char* path, WordList* listToExpand){
if(lastToExpand){
printf("found %i files in %s, looking for regex %s\n", getFiles(getPath(path), getFileName(path))->size,getPath(path), getFileName(path));
concatWordList(listToExpand, getFiles(getPath(path), getFileName(path)));
printf("listToExpand should be : \n");
printWordList(listToExpand);
free(pathToList);
}
else{
@ -110,13 +113,13 @@ void recursiveExpandWord(char* path, WordList* listToExpand){
char* correctedPath = concatWordListToWord(pathToList,0, indexToExpand + 1);
printf("correctedPath is : %s\n", correctedPath);
WordList* foundFiles = getFiles(getPath(correctedPath), getFileName(correctedPath));
printf("list of found files :\n");
printf("list of found files in %s, looking for regex %s:\n", getPath(correctedPath), getFileName(correctedPath));
printWordList(foundFiles);
if(foundFiles->size > 0){
tempElement = foundFiles->first;
char* concatenedEndOfPath = concatWordListToWord(pathToList, indexToExpand + 1, pathToList->size - 1);
char* concatenedEndOfPath = concatWordListToWord(pathToList, indexToExpand, pathToList->size - 1);
printf("list to be concatened is : \n");
printWordList(pathToList);
printf("concatenedEndOfPath is : %s\n", concatenedEndOfPath);
@ -185,12 +188,19 @@ char* getFileName(char* string){
return string;
}
else{
int i = 0;
/*int i = 0;
while(string[i] != '/'){
i++;
}
return strndup(string + i + 1, strlen(string) - i);
return strndup(string + i + 1, strlen(string) - i);*/
int i = strlen(string) - 1;
while(string[i] != '/'){
i--;
}
printf("strndup SAID %s\n", strndup(string + 1 + i,strlen(string) - 1));
return strndup(string + i + 1,strlen(string) - 1);
}
}