diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-02-17 01:09:25 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-02-17 01:11:40 +0100 |
| commit | 4efa0d0f0303be076d013c61a83b2d769778f37d (patch) | |
| tree | 071086c4842c1ea341572b9ee1e89ea8d18e9a19 /src | |
| parent | 4517c11fc188e2761fc7635c5379ca6b82119075 (diff) | |
| download | tmus-4efa0d0f0303be076d013c61a83b2d769778f37d.tar.gz tmus-4efa0d0f0303be076d013c61a83b2d769778f37d.zip | |
fixup! Remove files if a copy is already in trash
Diffstat (limited to 'src')
| -rw-r--r-- | src/data.c | 2 | ||||
| -rw-r--r-- | src/tui.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -566,6 +566,8 @@ track_move(struct track *track, struct tag *tag) struct track *new; char *newpath; + errno = 0; + newpath = aprintf("%s/%s", tag->fpath, track->name); if (path_exists(newpath)) { free(newpath); @@ -590,8 +590,8 @@ delete_current_track(void) USER_STATUS("Failed to remove track"); } else { if (!track_move(track, trash_tag) && errno != EEXIST) - USER_STATUS("Failed to trash track"); - if (!track_rm(track, true)) + USER_STATUS("Failed to trash track: %s", strerror(errno)); + if (errno == EEXIST && !track_rm(track, true)) USER_STATUS("Failed to remove track"); } |
