mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 19:15:41 +00:00
Always use the same type of slashes
This commit is contained in:
parent
d2f8539a42
commit
8ac9dd8e70
1 changed files with 8 additions and 11 deletions
|
@ -104,13 +104,10 @@ class DirArchive: public Ogre::FileSystemArchive
|
||||||
std::vector<std::string> current;
|
std::vector<std::string> current;
|
||||||
{
|
{
|
||||||
std::map<std::string,std::vector<std::string>,ciLessBoost>::const_iterator found = m.find(folder);
|
std::map<std::string,std::vector<std::string>,ciLessBoost>::const_iterator found = m.find(folder);
|
||||||
if (found == m.end())
|
|
||||||
{
|
|
||||||
std::replace(folder.begin(), folder.end(), '/', '\\');
|
|
||||||
found = m.find(folder);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found != m.end())
|
if (found == m.end())
|
||||||
|
return false;
|
||||||
|
else
|
||||||
current = found->second;
|
current = found->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,16 +131,14 @@ class DirArchive: public Ogre::FileSystemArchive
|
||||||
//need to cut off first
|
//need to cut off first
|
||||||
boost::filesystem::directory_iterator dir_iter(d), dir_end;
|
boost::filesystem::directory_iterator dir_iter(d), dir_end;
|
||||||
std::vector<std::string> filesind;
|
std::vector<std::string> filesind;
|
||||||
boost::filesystem::path f;
|
|
||||||
for(;dir_iter != dir_end; dir_iter++)
|
for(;dir_iter != dir_end; dir_iter++)
|
||||||
{
|
{
|
||||||
if(boost::filesystem::is_directory(*dir_iter))
|
if(boost::filesystem::is_directory(*dir_iter))
|
||||||
populateMap(*dir_iter);
|
populateMap(*dir_iter);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::string s = dir_iter->path().string();
|
||||||
f = *dir_iter;
|
std::replace(s.begin(), s.end(), '\\', '/');
|
||||||
std::string s = f.string();
|
|
||||||
|
|
||||||
std::string small;
|
std::string small;
|
||||||
if(cutoff < s.size())
|
if(cutoff < s.size())
|
||||||
|
@ -155,14 +150,16 @@ class DirArchive: public Ogre::FileSystemArchive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::sort(filesind.begin(), filesind.end(), ciLessBoost());
|
std::sort(filesind.begin(), filesind.end(), ciLessBoost());
|
||||||
|
|
||||||
std::string small;
|
std::string small;
|
||||||
std::string original = d.string();
|
std::string original = d.string();
|
||||||
|
std::replace(original.begin(), original.end(), '\\', '/');
|
||||||
if(cutoff < original.size())
|
if(cutoff < original.size())
|
||||||
small = original.substr(cutoff, original.size() - cutoff);
|
small = original.substr(cutoff, original.size() - cutoff);
|
||||||
else
|
else
|
||||||
small = original.substr(cutoff - 1, original.size() - cutoff);
|
small = original.substr(cutoff - 1, original.size() - cutoff);
|
||||||
m[small] = filesind;
|
|
||||||
|
|
||||||
|
m[small] = filesind;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCaseSensitive() const { return fsstrict; }
|
bool isCaseSensitive() const { return fsstrict; }
|
||||||
|
|
Loading…
Reference in a new issue