Skip to content

Commit 5d57e21

Browse files
committed
Fix makeDirsPath for absolute paths on linux
1 parent b445f0c commit 5d57e21

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wsjcpp_core.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ bool WsjcppCore::makeDirsPath(const std::string &sDirname) {
549549
std::string sDirpath = WsjcppCore::doNormalizePath(sDirname);
550550
std::vector<std::string> vDirs = WsjcppCore::split(sDirpath, "/");
551551
std::string sDirpath2 = "";
552+
if (sDirpath.length() > 0 && sDirpath[0] == '/') {
553+
sDirpath2 = "/";
554+
}
552555
for (int i = 0; i < vDirs.size(); i++) {
553556
if (vDirs[i] == "") {
554557
continue;

0 commit comments

Comments
 (0)