When a lua script is provided on the command line with the --loadlua option. Added code to always resolve any relative file path to an absolute as the lua core changes the current working directory which then invalidates the relative pathing from where the current working directory was at the time the program had initially been started.
This commit is contained in:
parent
7fb5ed52c4
commit
bcbac77084
|
@ -915,6 +915,15 @@ int main(int argc, char *argv[])
|
|||
g_config->setOption("SDL.LuaScript", "");
|
||||
if (s != "")
|
||||
{
|
||||
#ifdef __linux
|
||||
// Resolve absolute path to file
|
||||
char fullpath[2048];
|
||||
if ( realpath( s.c_str(), fullpath ) != NULL )
|
||||
{
|
||||
//printf("Fullpath: '%s'\n", fullpath );
|
||||
s.assign( fullpath );
|
||||
}
|
||||
#endif
|
||||
FCEU_LoadLuaCode(s.c_str());
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue