From c5e1b327c6a0177baadba1fa936b6037fec70b10 Mon Sep 17 00:00:00 2001 From: GNSS-Stylist Date: Fri, 9 Feb 2024 18:11:02 +0200 Subject: [PATCH] Fix invalid file path handling in Windows when there is dot in the file name This basically re-adds dot-removal removed by the previous commit. --- drivers/windows/file_access_windows.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 163ac4152ca..aae06505cdf 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -60,7 +60,12 @@ void FileAccessWindows::check_errors() const { bool FileAccessWindows::is_path_invalid(const String &p_path) { // Check for invalid operating system file. - String fname = p_path.get_file().get_basename().to_lower(); + String fname = p_path.get_file().to_lower(); + + int dot = fname.find("."); + if (dot != -1) { + fname = fname.substr(0, dot); + } return invalid_files.has(fname); }