src/find.c
//gets the struct that contains all the lines read from the input file and looks for the "r" at the end which indicates recursive read
gets the struct that contains all the lines read from the input file and looks for the "r" at the end which indicates recursive read
gets the struct that contains all the lines read from the input file and looks for the " r " at the end which indicates recursive read
void checkingForRecursion(llist *lCurr, const char *excluded){
    int index = 0;
    char *rec = NULL;  
    while(lCurr != NULL){ 
        rec = strchr(lCurr->line, ' '); 
        if(rec != NULL) {
            rec++; 
            index = 0;
            while(1){ 
                if(lCurr->line[index] == ' '){
                    lCurr->line[index] = '\0';
                    break;
                }
                index++;
            }
        }
        if(excluded != NULL){ 
            if(strcmp(excluded,getFilenameExt(lCurr->line)) == 0){
                lCurr = lCurr->next;
                continue;
            }
        }
        if (isRegularFile(lCurr->line)){  
            listFilesRecursively(lCurr->line, rec, 0, excluded);
        }else{
            listFilesRecursively(lCurr->line, rec, 1, excluded);  
        }
        lCurr = lCurr->next; 
    }
}
void checkingForRecursion ( llist * lCurr , const char * excluded ) { int index = 0 ; char * rec = NULL ; while ( lCurr != NULL ) { rec = strchr ( lCurr -> line , ' ' ) ; if ( rec != NULL ) { rec ++ ; index = 0 ; while ( 1 ) { if ( lCurr -> line [ index ] == ' ' ) { lCurr -> line [ index ] = ' \0 ' ; break ; } index ++ ; } } if ( excluded != NULL ) { if ( strcmp ( excluded , getFilenameExt ( lCurr -> line ) ) == 0 ) { lCurr = lCurr -> next ; continue ; } } if ( isRegularFile ( lCurr -> line ) ) { listFilesRecursively ( lCurr -> line , rec , 0 , excluded ) ; } else { listFilesRecursively ( lCurr -> line , rec , 1 , excluded ) ; } lCurr = lCurr -> next ; } }
gets the struct that contains all the lines read from the input file and looks for the "r" at the end which indicates recursive read
gets the struct that contains all the lines read from the input file and looks for the " r " at the end which indicates recursive read
//will store the r that indicates if a file should be read recursively //traverse the lineList structure //saving into rec the "r" if present //using this loop the save into line only the path, eliminating the "r" at the end. //discards all the files with the extension to exclude (in case has been passed) //If it is a file we pass to the function a zero //if it is a directory we pass 1. //pointing to the next line.