From 704e10c55a51492c65829985cb2947c6e9a86862 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 6 Jan 2020 11:32:17 +0100 Subject: [PATCH] Replaced unix basename() with boost::filesystem::basename(), as various unices define basename() differently. --- src/slic3r/GUI/RemovableDriveManager.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp index 9ef31748de..8586cf4748 100644 --- a/src/slic3r/GUI/RemovableDriveManager.cpp +++ b/src/slic3r/GUI/RemovableDriveManager.cpp @@ -21,6 +21,7 @@ GUID WceusbshGUID = { 0x25dbce51, 0x6c8f, 0x4a72, #include #include #include +#include #endif namespace Slic3r { @@ -321,14 +322,8 @@ void RemovableDriveManager::inspect_file(const std::string &path, const std::str uid_t uid = buf.st_uid; std::string username(std::getenv("USER")); struct passwd *pw = getpwuid(uid); - if(pw != 0) - { - if(pw->pw_name == username) - { - std::string name = basename(path.data()); - m_current_drives.push_back(DriveData(name,path)); - } - } + if (pw != 0 && pw->pw_name == username) + m_current_drives.push_back(DriveData(boost::filesystem::basename(boost::filesystem::path(path)), path)); } }