From 21703aefee3acf111e7cc7c7a184c3f5e8c85395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 1 Apr 2020 10:22:05 +0200 Subject: [PATCH] Fix res:// trimmed to s:// on Windows --- drivers/windows/dir_access_windows.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 5d1ab48106c..c5a710ee8dc 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -209,8 +209,15 @@ String DirAccessWindows::get_current_dir() { String DirAccessWindows::get_current_dir_without_drive() { String dir = get_current_dir(); - int p = current_dir.find(":"); - return p != -1 ? dir.right(p + 1) : dir; + + if (_get_root_string() == "") { + int p = current_dir.find(":"); + if (p != -1) { + dir = dir.right(p + 1); + } + } + + return dir; } bool DirAccessWindows::file_exists(String p_file) {