diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-17 14:57:29 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-17 14:57:29 -0300 |
commit | ed2872cd3bf6d352f36bbd34529738a60b0b51eb (patch) | |
tree | a4476cca4a43deeb8eaa0d52f0f02b15acc0db09 /lundump.c | |
parent | 2d3f09544895b422eeecf89e0d108da8b8fcdfca (diff) | |
download | lua-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 | ||
273 | static void checkHeader (LoadState *S) { | 273 | static 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) |