From 345267048defae61a8cb253e4b9061687d841141 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 20 Aug 2012 03:34:01 +0200 Subject: Remove all directories. --- organizemusic.cpp | 8 ++------ 1 file 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) { -- cgit v1.2.3-59-g8ed1b