X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Floader%2Futility.cpp;fp=src%2Floader%2Futility.cpp;h=6d336672de217889888b26c8600cf3a5dbd8fb92;hb=388749ada52bb177370f4f58766458b030b8a50a;hp=f5011e6fe243ea97685ffefab3eb7421b93d8aa2;hpb=7286b159e93a45d94d7a107a271d415beecdbc34;p=l2e.git diff --git a/src/loader/utility.cpp b/src/loader/utility.cpp index f5011e6..6d33667 100644 --- a/src/loader/utility.cpp +++ b/src/loader/utility.cpp @@ -15,7 +15,6 @@ using std::string; namespace loader { string Dirname(const string &path) { - // unix version char *str(new char[path.size() + 1]); std::memcpy(str, path.c_str(), path.size()); str[path.size()] = '\0'; @@ -25,12 +24,13 @@ string Dirname(const string &path) { } string CatPath(const string &lhs, const string &rhs) { - // unix version string path(lhs); - if (!path.empty() && path[path.size() - 1] != '/') { + if (!path.empty() + && path[path.size() - 1] != '/' + && path[path.size() - 1] != '\\') { path += '/'; } - if (!rhs.empty() && rhs[0] == '/') { + if (!rhs.empty() && (rhs[0] == '/' || rhs[0] == '\\')) { path.append(rhs, 1, string::npos); } else { path += rhs;