aboutsummaryrefslogtreecommitdiffstats
path: root/organizemusic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'organizemusic.cpp')
-rw-r--r--organizemusic.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/organizemusic.cpp b/organizemusic.cpp
index fa862ee..bd4a433 100644
--- a/organizemusic.cpp
+++ b/organizemusic.cpp
@@ -145,12 +145,6 @@ void rename_path(const string &source, const string &stem, ino_t inode)
perror(destination.c_str());
cerr << RESET;
}
- pos = source.find_last_of('/');
- if (pos != string::npos) {
- string dirname = source.substr(0, pos);
- if (!rmdir(dirname.c_str()))
- cout << BLUE << "rmdir" << RESET << ": " << dirname << endl;
- }
}
void make_parents(const string &filepath)
{
@@ -192,6 +186,8 @@ void process_directory(const char *directory)
process_path(joined);
}
closedir(dir);
+ if (!rmdir(directory))
+ cout << BLUE << "rmdir" << RESET << ": " << directory << endl;
}
void process_path(const char *path)
{