Skip to content

Commit 9b5797f

Browse files
committed
Fix bug, should copy std::filesystem::path before rename
1 parent c859c44 commit 9b5797f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/luaumb.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ int main(int argc, char** argv) {
6767
}
6868
}
6969

70-
if (std::optional<std::string> config_file = readFile(module_path.path.replace_filename(Luau::kConfigName).string())) {
70+
const std::filesystem::path config_file_path = module_path.path.parent_path() / Luau::kConfigName;
71+
if (std::optional<std::string> config_file = readFile(config_file_path.string())) {
7172
Luau::ConfigOptions config_option = {false, std::optional<Luau::ConfigOptions::AliasOptions>({config_file_relative_path, true})};
7273
std::optional<std::string> error = Luau::parseConfig(*config_file, config, config_option);
7374

0 commit comments

Comments
 (0)