Skip to content

Commit e6ee08b

Browse files
committed
Solve some bugs in windows respect to plugin_extension.
1 parent d55f8de commit e6ee08b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/extensions/plugin_extension/source/plugin_extension.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,19 @@ int plugin_extension(void *loader, void *handle, void *context)
9797
fs::directory_entry dir(*i);
9898
if (dir.is_regular_file())
9999
{
100-
std::string config = dir.path().filename().c_str();
100+
std::string config = dir.path().filename().string();
101101

102102
if (config == "metacall.json" ||
103103
(config.substr(0, m_begins.size()) == m_begins &&
104104
config.substr(config.size() - m_ends.size()) == m_ends))
105105
{
106-
log_write("metacall", LOG_LEVEL_DEBUG, "Loading extension: %s", dir.path().filename().c_str());
106+
log_write("metacall", LOG_LEVEL_DEBUG, "Loading extension: %s", config.c_str());
107107

108-
if (metacall_load_from_configuration(dir.path().c_str(), &handle, config_allocator) != 0)
108+
const char *dir_path_str = dir.path().string().c_str();
109+
110+
if (metacall_load_from_configuration(dir_path_str, &handle, config_allocator) != 0)
109111
{
110-
log_write("metacall", LOG_LEVEL_ERROR, "Failed to load extension: %s", dir.path().c_str());
112+
log_write("metacall", LOG_LEVEL_ERROR, "Failed to load extension: %s", dir_path_str);
111113
return 1;
112114
}
113115

0 commit comments

Comments
 (0)