From 88e58b658ba08cedf9214c01200819da354a1796 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 21 Jun 2024 00:40:22 -0500 Subject: Clean up commented code --- src/search.c | 59 +---------------------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/src/search.c b/src/search.c index eb39e08..3488136 100644 --- a/src/search.c +++ b/src/search.c @@ -100,66 +100,9 @@ struct nodelist* scanfolders(const char *STARTPATH, int (*cmp)(const struct dire } int main(void) { - /* - struct dirent **nodes; - int n; - - char *actualpath = NULL; - n = scandir("./", &nodes, foldersort, alphasort); - if(n >= 0) { - int cnt; - for(cnt = 0; cnt < n; ++cnt) { - actualpath = realpath(nodes[cnt]->d_name, actualpath); - puts(actualpath); - free(actualpath); - } - - } else - perror("Couldn't open the directory"); - //*/ - - /* - struct dirent **nodes = NULL; - - struct nodelist *scanner = nodelist_init(NULL), *holder = NULL, *start = scanner; - scanner->fullpath = realpath("./", NULL); - - for(; scanner != NULL; scanner = scanner->next) { - if(chdir(scanner->fullpath) < 0) { - error(0, errno, "Couldn't change to dir \"%s\". Skipping scan of that folder", scanner->fullpath); - continue; - } - - int n = scandir(scanner->fullpath, &nodes, foldersort, alphasort); - if(n >= 0) { - for(int i = 0; i < n; i++) { - holder = nodelist_init(NULL); - holder->fullpath = realpath(nodes[i]->d_name, NULL); - nodelist_append(scanner, holder); // Yeah this is slow but idk rn - } - } else - error(-1, errno, "Couldn't open dir \"%s\"", scanner->fullpath); - - } - - for(struct nodelist *p = start; p != NULL; p = p->next) { - if(p->fullpath != NULL) - printf("%s\n", p->fullpath); - } - - nodelist_delete(start); - //*/ - struct nodelist *folders = NULL; - folders = scanfolders("./", alphasort); - - /* - for(struct nodelist *p = folders; p != NULL; p = p->next) - printf("%s\n", p->fullpath); - */ - - //* + struct dirent **nodes; int n; -- cgit v1.2.3