Sfoglia il codice sorgente

Merge pull request #88144 from GNSS-Stylist/ConDotFix

Fix invalid file path handling in Windows when there is dot in the file name
Rémi Verschelde 1 anno fa
parent
commit
d3a8ae8b86
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      drivers/windows/file_access_windows.cpp

+ 6 - 1
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);
 }