Browse Source

Fix the `String::get_base_dir()` logic to properly check for top level directories on Windows.

Fredia Huya-Kouadio 4 years ago
parent
commit
8edacea04a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      core/string/ustring.cpp

+ 4 - 1
core/string/ustring.cpp

@@ -4285,7 +4285,10 @@ bool String::is_rel_path() const {
 }
 
 String String::get_base_dir() const {
-	int basepos = find("://");
+	int basepos = find(":/");
+	if (basepos == -1) {
+		basepos = find(":\\");
+	}
 	String rs;
 	String base;
 	if (basepos != -1) {