diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-04-08 14:28:26 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-04-08 14:28:26 -0300 |
| commit | 0897c0a4289ef3a8d45761266124613f364bef60 (patch) | |
| tree | 749c0fa121f686c65a9d8c2c909c7bd04f9c6b34 | |
| parent | 5edacafcfa36a1fa86a7b5316bacf8c6a2c47227 (diff) | |
| download | lua-0897c0a4289ef3a8d45761266124613f364bef60.tar.gz lua-0897c0a4289ef3a8d45761266124613f364bef60.tar.bz2 lua-0897c0a4289ef3a8d45761266124613f364bef60.zip | |
'getmode' renamed to 'getMode'
The name 'getmode' conficts with a function from BSD, defined
in <unistd.h>. Although 'lbaselib.c' cannot include that header,
'onelua.c' can.
| -rw-r--r-- | lbaselib.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -336,7 +336,7 @@ static int load_aux (lua_State *L, int status, int envidx) { | |||
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | 338 | ||
| 339 | static const char *getmode (lua_State *L, int idx) { | 339 | static const char *getMode (lua_State *L, int idx) { |
| 340 | const char *mode = luaL_optstring(L, idx, "bt"); | 340 | const char *mode = luaL_optstring(L, idx, "bt"); |
| 341 | if (strchr(mode, 'B') != NULL) /* Lua code cannot use fixed buffers */ | 341 | if (strchr(mode, 'B') != NULL) /* Lua code cannot use fixed buffers */ |
| 342 | luaL_argerror(L, idx, "invalid mode"); | 342 | luaL_argerror(L, idx, "invalid mode"); |
| @@ -346,7 +346,7 @@ static const char *getmode (lua_State *L, int idx) { | |||
| 346 | 346 | ||
| 347 | static int luaB_loadfile (lua_State *L) { | 347 | static int luaB_loadfile (lua_State *L) { |
| 348 | const char *fname = luaL_optstring(L, 1, NULL); | 348 | const char *fname = luaL_optstring(L, 1, NULL); |
| 349 | const char *mode = getmode(L, 2); | 349 | const char *mode = getMode(L, 2); |
| 350 | int env = (!lua_isnone(L, 3) ? 3 : 0); /* 'env' index or 0 if no 'env' */ | 350 | int env = (!lua_isnone(L, 3) ? 3 : 0); /* 'env' index or 0 if no 'env' */ |
| 351 | int status = luaL_loadfilex(L, fname, mode); | 351 | int status = luaL_loadfilex(L, fname, mode); |
| 352 | return load_aux(L, status, env); | 352 | return load_aux(L, status, env); |
| @@ -395,7 +395,7 @@ static int luaB_load (lua_State *L) { | |||
| 395 | int status; | 395 | int status; |
| 396 | size_t l; | 396 | size_t l; |
| 397 | const char *s = lua_tolstring(L, 1, &l); | 397 | const char *s = lua_tolstring(L, 1, &l); |
| 398 | const char *mode = getmode(L, 3); | 398 | const char *mode = getMode(L, 3); |
| 399 | int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */ | 399 | int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */ |
| 400 | if (s != NULL) { /* loading a string? */ | 400 | if (s != NULL) { /* loading a string? */ |
| 401 | const char *chunkname = luaL_optstring(L, 2, s); | 401 | const char *chunkname = luaL_optstring(L, 2, s); |
