Skip to content

Commit

Permalink
Fix error handling on call to access(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmv committed Aug 2, 2014
1 parent 19fa359 commit a23c7b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion state.cpp
Expand Up @@ -492,7 +492,7 @@ lutok::state::is_userdata(const int index)
void
lutok::state::load_file(const std::string& file)
{
if (!::access(file.c_str(), R_OK) == 0)
if (::access(file.c_str(), R_OK) == -1)
throw lutok::file_not_found_error(file);
if (luaL_loadfile(_pimpl->lua_state, file.c_str()) != 0)
throw lutok::api_error::from_stack(*this, "luaL_loadfile");
Expand Down

0 comments on commit a23c7b8

Please sign in to comment.