Scripting: Why does this function take PCWSTR??

This commit is contained in:
Vicki Pfau 2022-06-08 18:04:43 -07:00
parent 6e196748d8
commit b42b997f00
1 changed files with 2 additions and 2 deletions

View File

@ -486,7 +486,7 @@ bool _luaLoad(struct mScriptEngineContext* ctx, const char* filename, struct VFi
snprintf(name, sizeof(name), "=%s", filename + 1);
} else {
#ifdef _WIN32
char dirname[PATH_MAX] = {0};
wchar_t dirname[PATH_MAX] = {0};
const char* lastSlash = strrchr(filename, '/');
const char* lastBackslash = strrchr(filename, '\\');
if (lastSlash && lastBackslash) {
@ -497,7 +497,7 @@ bool _luaLoad(struct mScriptEngineContext* ctx, const char* filename, struct VFi
lastSlash = lastBackslash;
}
if (lastSlash) {
strncpy(dirname, filename, lastSlash - filename);
MultiByteToWideChar(CP_UTF8, 0, filename, lastSlash - filename, dirname, PATH_MAX);
AddDllDirectory(dirname);
}
#endif