diff --git a/src/core/pack.cpp b/src/core/pack.cpp index 134930a8..0ee1c64f 100644 --- a/src/core/pack.cpp +++ b/src/core/pack.cpp @@ -2,6 +2,7 @@ #include "fileutil.h" #include "jsonutil.h" #include +#include #include "sha256.h" @@ -419,6 +420,15 @@ void Pack::addSearchPath(const std::string& path) return; _searchPaths.push_back(real); } else +#else + char* tmp = _fullpath(NULL, path.c_str(), 1024); + if (tmp) { + auto cmp = [tmp](const std::string& s) { return strcasecmp(tmp, s.c_str()) == 0; }; + if (std::find_if(_searchPaths.begin(), _searchPaths.end(), cmp) != _searchPaths.end()) + return; + _searchPaths.push_back(tmp); + free(tmp); + } else #endif { if (std::find(_searchPaths.begin(), _searchPaths.end(), path) != _searchPaths.end())