Replaced unix basename() with boost::filesystem::basename(),
as various unices define basename() differently.
This commit is contained in:
parent
791f487c76
commit
704e10c55a
1 changed files with 3 additions and 8 deletions
|
@ -21,6 +21,7 @@ GUID WceusbshGUID = { 0x25dbce51, 0x6c8f, 0x4a72,
|
|||
#include <libgen.h>
|
||||
#include <pwd.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue