diff options
Diffstat (limited to 'drivers/windows')
-rw-r--r-- | drivers/windows/dir_access_windows.cpp | 8 | ||||
-rw-r--r-- | drivers/windows/dir_access_windows.h | 2 |
2 files changed, 7 insertions, 3 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) { diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h index 43951c0be9..f59e4d7030 100644 --- a/drivers/windows/dir_access_windows.h +++ b/drivers/windows/dir_access_windows.h @@ -69,7 +69,7 @@ public: virtual String get_drive(int p_drive); virtual Error change_dir(String p_dir); ///< can be relative or absolute, return false on success - virtual String get_current_dir(); ///< return current dir location + virtual String get_current_dir(bool p_include_drive = true); ///< return current dir location virtual bool file_exists(String p_file); virtual bool dir_exists(String p_dir); |