summaryrefslogtreecommitdiff
path: root/core/os/dir_access.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-05-19 21:36:35 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-05-19 21:36:35 -0300
commit221443c5a2d174e52d391d15d5f1c6b5c9496d57 (patch)
treedcea619ff3068a557c44aac5873676ea9e1a151c /core/os/dir_access.cpp
parentf220183e40cb100cdfb8158c5217076377a62980 (diff)
more fixes
-only refuse to load an older file if version major is different, fixes #1944 -fix drive letter default value, fixes #1939
Diffstat (limited to 'core/os/dir_access.cpp')
-rw-r--r--core/os/dir_access.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index a1031cf5f0..d0baae5872 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -56,6 +56,17 @@ String DirAccess::_get_root_string() const {
return "";
}
+int DirAccess::get_current_drive() {
+
+ String path = get_current_dir().to_lower();
+ for(int i=0;i<get_drive_count();i++) {
+ String d = get_drive(i).to_lower();
+ if (path.begins_with(d))
+ return i;
+ }
+
+ return 0;
+}
static Error _erase_recursive(DirAccess *da) {