From a892d256057ba5f75bf1483b30a7ecbae5b44d9c Mon Sep 17 00:00:00 2001 From: Oskar Date: Tue, 25 Jun 2024 17:28:12 +0200 Subject: added basename so we only get the filename --- trashsys.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'trashsys.c') diff --git a/trashsys.c b/trashsys.c index eaf5bc4..982d3bd 100644 --- a/trashsys.c +++ b/trashsys.c @@ -9,6 +9,7 @@ #include #include #include +#include #define USAGE "to be decided" #define MODE_NORMAL -1 @@ -114,7 +115,7 @@ struct trashsys_log_info { tli->ts_log_filename[0] = '\0'; strcat(tli->ts_log_originalpath, rp); free(rp); - strcat(tli->ts_log_filename, filename); + strcat(tli->ts_log_filename, basename(filename)); // record filename and basename it tli->ts_log_tmp = log_tmp; // tmp or not? tli->ts_log_trashtime = time(NULL); // record current time @@ -195,7 +196,7 @@ int main (int argc, char *argv[]) { } struct trashsys_log_info tli_m; - tli_fill_info(&tli_m , "myfile.img", false); + tli_fill_info(&tli_m , "../myfile.img", false); free_ipi(ipi_m); bool y_used = false; -- cgit v1.2.3