aboutsummaryrefslogtreecommitdiff
path: root/lundump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-04-17 14:57:29 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-04-17 14:57:29 -0300
commited2872cd3bf6d352f36bbd34529738a60b0b51eb (patch)
treea4476cca4a43deeb8eaa0d52f0f02b15acc0db09 /lundump.c
parent2d3f09544895b422eeecf89e0d108da8b8fcdfca (diff)
downloadlua-ed2872cd3bf6d352f36bbd34529738a60b0b51eb.tar.gz
lua-ed2872cd3bf6d352f36bbd34529738a60b0b51eb.tar.bz2
lua-ed2872cd3bf6d352f36bbd34529738a60b0b51eb.zip
'require' returns where module was found
The function 'require' returns the *loader data* as a second result. For file searchers, this data is the path where they found the module.
Diffstat (limited to 'lundump.c')
-rw-r--r--lundump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lundump.c b/lundump.c
index a6004933..c1cff9e1 100644
--- a/lundump.c
+++ b/lundump.c
@@ -271,8 +271,8 @@ static void fchecksize (LoadState *S, size_t size, const char *tname) {
271#define checksize(S,t) fchecksize(S,sizeof(t),#t) 271#define checksize(S,t) fchecksize(S,sizeof(t),#t)
272 272
273static void checkHeader (LoadState *S) { 273static void checkHeader (LoadState *S) {
274 /* 1st char already checked */ 274 /* skip 1st char (already read and checked) */
275 checkliteral(S, LUA_SIGNATURE + 1, "not a binary chunk"); 275 checkliteral(S, &LUA_SIGNATURE[1], "not a binary chunk");
276 if (LoadInt(S) != LUAC_VERSION) 276 if (LoadInt(S) != LUAC_VERSION)
277 error(S, "version mismatch"); 277 error(S, "version mismatch");
278 if (LoadByte(S) != LUAC_FORMAT) 278 if (LoadByte(S) != LUAC_FORMAT)