libgen.h confirmed to work with mingw, thanks foxblock
fixes #28
namespace loader {
string Dirname(const string &path) {
namespace loader {
string Dirname(const string &path) {
char *str(new char[path.size() + 1]);
std::memcpy(str, path.c_str(), path.size());
str[path.size()] = '\0';
char *str(new char[path.size() + 1]);
std::memcpy(str, path.c_str(), path.size());
str[path.size()] = '\0';
}
string CatPath(const string &lhs, const string &rhs) {
}
string CatPath(const string &lhs, const string &rhs) {
- if (!path.empty() && path[path.size() - 1] != '/') {
+ if (!path.empty()
+ && path[path.size() - 1] != '/'
+ && path[path.size() - 1] != '\\') {
- if (!rhs.empty() && rhs[0] == '/') {
+ if (!rhs.empty() && (rhs[0] == '/' || rhs[0] == '\\')) {
path.append(rhs, 1, string::npos);
} else {
path += rhs;
path.append(rhs, 1, string::npos);
} else {
path += rhs;