X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ffile_system.cpp;h=266da812f6be7a712190976a22d4533e2507eaa7;hb=a113d3bd1feddd510e3b2852b0d42522735eee40;hp=cb8f426d9cc93e898e6b9f5a1049d302608b1b2f;hpb=ff4c6994b952e26b854461d739eb3bcbfc30719f;p=supertux.git diff --git a/src/file_system.cpp b/src/file_system.cpp index cb8f426d9..266da812f 100644 --- a/src/file_system.cpp +++ b/src/file_system.cpp @@ -32,9 +32,9 @@ namespace FileSystem std::string dirname(const std::string& filename) { std::string::size_type p = filename.find_last_of('/'); - if(p == std::string::npos) + if(p == std::string::npos) return ""; - + return filename.substr(0, p+1); } @@ -76,11 +76,11 @@ std::string normalize(const std::string& filename) size_t len = p - pstart; if(len == 0) break; - + std::string pathelem(pstart, p-pstart); if(pathelem == ".") continue; - + if(pathelem == "..") { if(path_stack.empty()) { @@ -108,4 +108,3 @@ std::string normalize(const std::string& filename) } } -