mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added check for trailing '/' of base directory in RsAccountsDetail::setupBaseDirectory.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8464 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dd25e5dc31
commit
6a778ab904
@ -299,6 +299,20 @@ bool RsAccountsDetail::setupBaseDirectory(std::string alt_basedir)
|
|||||||
mBaseDirectory = alt_basedir;
|
mBaseDirectory = alt_basedir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check for trailing '/' */
|
||||||
|
if (!mBaseDirectory.empty())
|
||||||
|
{
|
||||||
|
char lastChar = *mBaseDirectory.rbegin();
|
||||||
|
if (lastChar == '/'
|
||||||
|
#ifdef WINDOWS_SYS
|
||||||
|
|| lastChar == '\\'
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
|
mBaseDirectory.erase(mBaseDirectory.end() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!RsDirUtil::checkCreateDirectory(mBaseDirectory))
|
if (!RsDirUtil::checkCreateDirectory(mBaseDirectory))
|
||||||
{
|
{
|
||||||
std::cerr << "RsAccounts::setupBaseDirectory() Cannot Create BaseConfig Dir:" << mBaseDirectory;
|
std::cerr << "RsAccounts::setupBaseDirectory() Cannot Create BaseConfig Dir:" << mBaseDirectory;
|
||||||
|
Loading…
Reference in New Issue
Block a user