diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-05-08 17:50:10 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-05-08 17:50:10 -0300 |
| commit | 262dc5729a28b2bad0b6413d4eab2290d14395cf (patch) | |
| tree | c92cbf6c6d5d88bc352dd71f7f27be4dd44cf16f /lua.c | |
| parent | 9d985db7bb09c92b5b3fa660fffe5907d01e6a02 (diff) | |
| download | lua-262dc5729a28b2bad0b6413d4eab2290d14395cf.tar.gz lua-262dc5729a28b2bad0b6413d4eab2290d14395cf.tar.bz2 lua-262dc5729a28b2bad0b6413d4eab2290d14395cf.zip | |
Details
Corrections in comments and manual. Added note in the manual about
local variables in the REPL.
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -211,7 +211,7 @@ static int dostring (lua_State *L, const char *s, const char *name) { | |||
| 211 | /* | 211 | /* |
| 212 | ** Receives 'globname[=modname]' and runs 'globname = require(modname)'. | 212 | ** Receives 'globname[=modname]' and runs 'globname = require(modname)'. |
| 213 | ** If there is no explicit modname and globname contains a '-', cut | 213 | ** If there is no explicit modname and globname contains a '-', cut |
| 214 | ** the sufix after '-' (the "version") to make the global name. | 214 | ** the suffix after '-' (the "version") to make the global name. |
| 215 | */ | 215 | */ |
| 216 | static int dolibrary (lua_State *L, char *globname) { | 216 | static int dolibrary (lua_State *L, char *globname) { |
| 217 | int status; | 217 | int status; |
| @@ -230,7 +230,7 @@ static int dolibrary (lua_State *L, char *globname) { | |||
| 230 | status = docall(L, 1, 1); /* call 'require(modname)' */ | 230 | status = docall(L, 1, 1); /* call 'require(modname)' */ |
| 231 | if (status == LUA_OK) { | 231 | if (status == LUA_OK) { |
| 232 | if (suffix != NULL) /* is there a suffix mark? */ | 232 | if (suffix != NULL) /* is there a suffix mark? */ |
| 233 | *suffix = '\0'; /* remove sufix from global name */ | 233 | *suffix = '\0'; /* remove suffix from global name */ |
| 234 | lua_setglobal(L, globname); /* globname = require(modname) */ | 234 | lua_setglobal(L, globname); /* globname = require(modname) */ |
| 235 | } | 235 | } |
| 236 | return report(L, status); | 236 | return report(L, status); |
