summaryrefslogtreecommitdiffstats
path: root/drivers/windows/dir_access_windows.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-04 13:19:55 +0100
committerGitHub <noreply@github.com>2020-03-04 13:19:55 +0100
commitf83f1d7c9b299f21f818e0ea28c27345f65bde4b (patch)
tree6142421a00cd01011e7bd433953f4800d381e3c6 /drivers/windows/dir_access_windows.cpp
parent2856740e6b238576273a321a125e9d92b687fdb2 (diff)
parentaee586553a4be72b72b669fb489fae72337ab7ad (diff)
downloadredot-engine-f83f1d7c9b299f21f818e0ea28c27345f65bde4b.tar.gz
Merge pull request #36069 from RandomShaper/imvu/improve_drives_ux
Improve UX of drive letters
Diffstat (limited to 'drivers/windows/dir_access_windows.cpp')
-rw-r--r--drivers/windows/dir_access_windows.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp
index 8e0eac6986..cf09f79832 100644
--- a/drivers/windows/dir_access_windows.cpp
+++ b/drivers/windows/dir_access_windows.cpp
@@ -189,7 +189,7 @@ Error DirAccessWindows::make_dir(String p_dir) {
return ERR_CANT_CREATE;
}
-String DirAccessWindows::get_current_dir() {
+String DirAccessWindows::get_current_dir(bool p_include_drive) {
String base = _get_root_path();
if (base != "") {
@@ -203,7 +203,11 @@ String DirAccessWindows::get_current_dir() {
} else {
}
- return current_dir;
+ if (p_include_drive) {
+ return current_dir;
+ } else {
+ return current_dir.right(current_dir.find(":") + 1);
+ }
}
bool DirAccessWindows::file_exists(String p_file) {