From 79d0e0eb3c3af97a5c0afa9b5b64ffaca420d369 Mon Sep 17 00:00:00 2001 From: digant73 Date: Wed, 29 Apr 2026 23:36:14 +0200 Subject: [PATCH] reduce check for raw device --- Utilities/File.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Utilities/File.cpp b/Utilities/File.cpp index 0059673336..59ef528942 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -1127,6 +1127,13 @@ bool fs::is_optical_raw_device(const std::string& path) bool fs::get_optical_raw_device(const std::string& path, std::string* raw_device) { + // Skip a useless check to detect an optical raw device if navigating on subfolders (e.g. C:/subfolder_1/subfolder_2/), it means we are on a hdd/ssd. + // A path for an optical drive should include only the drive letter (e.g. E:/) + if (path.find_first_of(":") != path.find_last_not_of(delim)) + { + return false; + } + if (fs::is_optical_raw_device(path)) { if (raw_device)