forked from mia/Aegisub
Check for both forward and back slashes in the windows version of util::DirName
Originally committed to SVN as r4792.
This commit is contained in:
parent
1dedfb18cd
commit
682fd9406c
1 changed files with 5 additions and 4 deletions
|
@ -39,11 +39,12 @@ namespace agi {
|
|||
using agi::charset::ConvertW;
|
||||
|
||||
const std::string DirName(const std::string& path) {
|
||||
if (path.find('/') == std::string::npos) {
|
||||
return ".";
|
||||
}
|
||||
std::string::size_type pos = path.rfind('/');
|
||||
|
||||
return path.substr(0, path.rfind("/")+1);
|
||||
if (pos == std::string::npos) pos = path.rfind('\\');
|
||||
if (pos == std::string::npos) return ".";
|
||||
|
||||
return path.substr(0, pos+1);
|
||||
}
|
||||
|
||||
void Rename(const std::string& from, const std::string& to) {
|
||||
|
|
Loading…
Reference in a new issue