diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index d823ae04..4ab56df4 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -753,7 +753,8 @@ int fceuWrapperInit( int argc, char *argv[] ) g_config->setOption("SDL.LuaScript", ""); if (s != "") { -#ifdef __linux +#if defined(__linux) || defined(__APPLE__) + // Resolve absolute path to file char fullpath[2048]; if ( realpath( s.c_str(), fullpath ) != NULL ) diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 4b27d8ff..e0316e2a 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -618,16 +618,10 @@ static int emu_loadrom(lua_State *L) const char *nameo2 = luaL_checkstring(L,1); char nameo[2048]; - if ( nameo2[0] == '/' ) + if ( realpath( nameo2, nameo ) == NULL ) { strncpy(nameo, nameo2, sizeof(nameo)); } - else - { - char cwd[1024]; - getcwd( cwd, sizeof(cwd) ); - snprintf( nameo, sizeof(nameo), "%s/%s", cwd, nameo2 ); - } //printf("Load ROM: '%s'\n", nameo ); if (!LoadGame(nameo, true)) {