[Widelands-cvs] SF.net SVN: widelands:[5015] trunk/src/io/filesystem/filesystem.cc
Status: Beta
Brought to you by:
sirver
From: <si...@us...> - 2010-01-22 20:47:38
|
Revision: 5015 http://widelands.svn.sourceforge.net/widelands/?rev=5015&view=rev Author: sirver Date: 2010-01-22 20:47:27 +0000 (Fri, 22 Jan 2010) Log Message: ----------- merge fs-optimisation: The file path will always end up absolute, so simplify the code. Modified Paths: -------------- trunk/src/io/filesystem/filesystem.cc Modified: trunk/src/io/filesystem/filesystem.cc =================================================================== --- trunk/src/io/filesystem/filesystem.cc 2010-01-22 20:46:30 UTC (rev 5014) +++ trunk/src/io/filesystem/filesystem.cc 2010-01-22 20:47:27 UTC (rev 5015) @@ -243,15 +243,13 @@ components.erase(components.begin()); FS_Tokenize(GetHomedir(), m_filesep, std::inserter(components, components.begin())); - absolute = true; } //make relative paths absolute (so that "../../foo" can work) - if (!absolute) { + else if (!absolute) { FS_Tokenize (m_root.empty() ? getWorkingDirectory() : m_root, m_filesep, std::inserter(components, components.begin())); - absolute = true; } //clean up the path @@ -277,17 +275,12 @@ std::string canonpath; canonpath.reserve(path.length()); #ifndef WIN32 - if (!absolute) - canonpath = "."; - for (i = components.begin(); i != components.end(); ++i) { canonpath.push_back('/'); canonpath += *i; } #else - canonpath = absolute ? "" : ".\\"; - for (i = components.begin(); i != components.end(); ++i) canonpath += *i + "\\"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |