diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-02-16 18:09:49 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-02-16 18:09:49 +0100 |
| commit | b2a3856a381b1e7a9e399552a9b6041aaff9ff76 (patch) | |
| tree | fbe9c5056e6622c1cbee49441c06aa438ebf9d50 /src | |
| parent | 4043e0c796f3be54414ef903caaa95f6f08aa8e0 (diff) | |
| download | tmus-b2a3856a381b1e7a9e399552a9b6041aaff9ff76.tar.gz tmus-b2a3856a381b1e7a9e399552a9b6041aaff9ff76.zip | |
Remove files if a copy is already in trash
Diffstat (limited to 'src')
| -rw-r--r-- | src/tui.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -17,9 +17,10 @@ #include <ncurses.h> +#include <unistd.h> +#include <errno.h> #include <ctype.h> #include <string.h> -#include <unistd.h> #undef KEY_ENTER #define KEY_ENTER '\n' @@ -589,8 +590,10 @@ delete_current_track(void) if (!track_rm(track, true)) USER_STATUS("Failed to remove track"); } else { - if (!track_move(track, trash_tag)) + if (!track_move(track, trash_tag) && errno != EEXIST) USER_STATUS("Failed to trash track"); + if (!track_rm(track, true)) + USER_STATUS("Failed to remove track"); } return true; |
