Skip to content

Commit 79d0e0e

Browse files
digant73elad335
authored andcommitted
reduce check for raw device
1 parent 570b2bd commit 79d0e0e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Utilities/File.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,13 @@ bool fs::is_optical_raw_device(const std::string& path)
11271127

11281128
bool fs::get_optical_raw_device(const std::string& path, std::string* raw_device)
11291129
{
1130+
// 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.
1131+
// A path for an optical drive should include only the drive letter (e.g. E:/)
1132+
if (path.find_first_of(":") != path.find_last_not_of(delim))
1133+
{
1134+
return false;
1135+
}
1136+
11301137
if (fs::is_optical_raw_device(path))
11311138
{
11321139
if (raw_device)

0 commit comments

Comments
 (0)