Skip to content

Commit 73d0231

Browse files
committed
Improve Output Path Checking
- More reliably check whether the desktop app's output path is valid
1 parent 03670d6 commit 73d0231

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gui/desktop/mainwindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,8 @@ void MainWindow::on_randomize_button_clicked()
12391239
}
12401240

12411241
// Check to make sure the output directory is not the same or a sub directory of the base game
1242-
if (config.outputDir.u32string().starts_with(config.gameBaseDir.u32string()))
1242+
const fspath& base = std::filesystem::weakly_canonical(config.gameBaseDir);
1243+
if (std::ranges::mismatch(base, std::filesystem::weakly_canonical(config.outputDir)).in1 == base.end())
12431244
{
12441245
show_warning_dialog("The output folder cannot be within the base game folder. Please select a different output folder.", "Bad output folder");
12451246
return;

0 commit comments

Comments
 (0)