From 5beaa2672441325409348a4e52344cfd24dd1ed0 Mon Sep 17 00:00:00 2001 From: Oskar Date: Mon, 1 Jul 2024 09:35:25 +0200 Subject: tmp case --- TODO | 4 ++-- trashsys.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index fba10c0..26a51ad 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,5 @@ -1. -2. +1. Change fill_ipi and instead of having it malloc and then return return it to have the pointer in main point to the malloc'd struct we might as well just pass the address directly to the function and fill it from there. Why even bother malloc'ing? If we remove malloc we can remove a lot of free() calls and remove a lot of complexity from the code. I mean we aren't even doing a damn linked list so why the hell would we even need to malloc a struct? Am i stupid? +2. Just a note: When implementing the -L -l functions we need to make it clear what's in tmp and whats not. Not sure exactly how ill do this but i have some ideas. One way of dealing with files in tmp is to force the user to pass the -t argument if they want to deal with tmp stuff. Like if i say: 'tsr -t -l' it will only list files in the tmp trashcan. Maybe that IS the best approach to this? 3. Implement function to read log files? And maybe act upon the read contents? I'll have to think more about this. 4. 5. Clean up some code, remove redundancy and make everything a little smarter where i can diff --git a/trashsys.c b/trashsys.c index f5b6287..343351a 100644 --- a/trashsys.c +++ b/trashsys.c @@ -223,7 +223,7 @@ struct initial_path_info *fill_ipi(bool t_used) { // Function for filling out in exit(EXIT_FAILURE); } - } else if (t_used == true) { + } else if (t_used == true) { // If -t flag is specified we fill ipi with /tmp paths instead if(concat_str(ipi->ts_path_user_home, PATH_MAX, ts_tmp) == NULL || concat_str(ipi->ts_path_trashsys, PATH_MAX, ts_tmp_toplevel) == NULL || concat_str(ipi->ts_path_log, PATH_MAX, ts_tmp_log) == NULL || -- cgit v1.2.3