summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/data.c2
-rw-r--r--src/tui.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/data.c b/src/data.c
index 1ba1147..31fe05a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -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);
diff --git a/src/tui.c b/src/tui.c
index b3af7f2..36d0c14 100644
--- a/src/tui.c
+++ b/src/tui.c
@@ -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");
}