Codechange: Use std::string in FIO search path handling.
This commit is contained in:
@@ -116,17 +116,16 @@ bool ScriptInstance::LoadCompatibilityScripts(const char *api_version, Subdirect
|
||||
{
|
||||
char script_name[32];
|
||||
seprintf(script_name, lastof(script_name), "compat_%s.nut", api_version);
|
||||
char buf[MAX_PATH];
|
||||
Searchpath sp;
|
||||
FOR_ALL_SEARCHPATHS(sp) {
|
||||
FioAppendDirectory(buf, lastof(buf), sp, dir);
|
||||
strecat(buf, script_name, lastof(buf));
|
||||
if (!FileExists(buf)) continue;
|
||||
std::string buf = FioGetDirectory(sp, dir);
|
||||
buf += script_name;
|
||||
if (!FileExists(buf.c_str())) continue;
|
||||
|
||||
if (this->engine->LoadScript(buf)) return true;
|
||||
if (this->engine->LoadScript(buf.c_str())) return true;
|
||||
|
||||
ScriptLog::Error("Failed to load API compatibility script");
|
||||
DEBUG(script, 0, "Error compiling / running API compatibility script: %s", buf);
|
||||
DEBUG(script, 0, "Error compiling / running API compatibility script: %s", buf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user