mirror of
https://github.com/znc/znc.git
synced 2026-05-03 12:02:30 +02:00
eat up extra /'s as needed when included in the path
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@97 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
11
Utils.cpp
11
Utils.cpp
@@ -162,9 +162,16 @@ int CUtils::MakeDir(const string& sPath, mode_t iMode) {
|
||||
if (iFind == string::npos) {
|
||||
return mkdir(sDir.c_str(), iMode);
|
||||
}
|
||||
iFind++;
|
||||
|
||||
string sWorkDir = sDir.substr(0, iFind + 1); // include the trailing slash
|
||||
string sNewDir = sDir.erase(0, iFind + 1);
|
||||
while( ( iFind < sDir.length() ) && ( sDir[iFind] == '/' ) )
|
||||
iFind++; // eat up extra /'s
|
||||
|
||||
if ( iFind >= sDir.length() )
|
||||
return mkdir(sDir.c_str(), iMode);
|
||||
|
||||
string sWorkDir = sDir.substr(0, iFind); // include the trailing slash
|
||||
string sNewDir = sDir.erase(0, iFind);
|
||||
|
||||
struct stat st;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user