Переглянути джерело

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

Fredia Huya-Kouadio 4 роки тому
батько
коміт
94aa09a854
1 змінених файлів з 4 додано та 1 видалено
  1. 4 1
      core/ustring.cpp

+ 4 - 1
core/ustring.cpp

@@ -3970,7 +3970,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) {