diff options
Diffstat (limited to 'loadlib.c')
| -rw-r--r-- | loadlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -408,10 +408,10 @@ static int ll_loadlib (lua_State *L) { | |||
| 408 | if (stat == 0) /* no errors? */ | 408 | if (stat == 0) /* no errors? */ |
| 409 | return 1; /* return the loaded function */ | 409 | return 1; /* return the loaded function */ |
| 410 | else { /* error; error message is on stack top */ | 410 | else { /* error; error message is on stack top */ |
| 411 | lua_pushnil(L); | 411 | luaL_pushfail(L); |
| 412 | lua_insert(L, -2); | 412 | lua_insert(L, -2); |
| 413 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); | 413 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); |
| 414 | return 3; /* return nil, error message, and where */ | 414 | return 3; /* return fail, error message, and where */ |
| 415 | } | 415 | } |
| 416 | } | 416 | } |
| 417 | 417 | ||
| @@ -505,9 +505,9 @@ static int ll_searchpath (lua_State *L) { | |||
| 505 | luaL_optstring(L, 4, LUA_DIRSEP)); | 505 | luaL_optstring(L, 4, LUA_DIRSEP)); |
| 506 | if (f != NULL) return 1; | 506 | if (f != NULL) return 1; |
| 507 | else { /* error message is on top of the stack */ | 507 | else { /* error message is on top of the stack */ |
| 508 | lua_pushnil(L); | 508 | luaL_pushfail(L); |
| 509 | lua_insert(L, -2); | 509 | lua_insert(L, -2); |
| 510 | return 2; /* return nil + error message */ | 510 | return 2; /* return fail + error message */ |
| 511 | } | 511 | } |
| 512 | } | 512 | } |
| 513 | 513 | ||
