mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-25 20:33:35 +00:00
Code cleanup
This commit is contained in:
parent
46fc22f72a
commit
a36dabc002
@ -206,14 +206,15 @@ bool RascsiImage::DeleteImage(int fd, const PbCommand& command)
|
|||||||
size_t last_slash = filename.rfind('/');
|
size_t last_slash = filename.rfind('/');
|
||||||
while (last_slash != string::npos) {
|
while (last_slash != string::npos) {
|
||||||
string folder = filename.substr(0, last_slash);
|
string folder = filename.substr(0, last_slash);
|
||||||
|
string full_folder = default_image_folder + "/" + folder;
|
||||||
|
|
||||||
std::error_code error;
|
std::error_code error;
|
||||||
if (!filesystem::is_empty(default_image_folder + "/" + folder, error) || error) {
|
if (!filesystem::is_empty(full_folder, error) || error) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remove((default_image_folder + "/" + folder).c_str())) {
|
if (remove(full_folder.c_str())) {
|
||||||
return ReturnStatus(fd, false, "Can't delete empty image folder '" + default_image_folder + "/" + folder +"'");
|
return ReturnStatus(fd, false, "Can't delete empty image folder '" + full_folder +"'");
|
||||||
}
|
}
|
||||||
|
|
||||||
last_slash = folder.rfind('/');
|
last_slash = folder.rfind('/');
|
||||||
|
Loading…
Reference in New Issue
Block a user