diff options
| author | Mike Pall <mike> | 2010-05-09 22:47:09 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2010-05-09 22:47:09 +0200 |
| commit | 655401f3e9eb0250108c8a17bb0eddd5f192eeb2 (patch) | |
| tree | acec339f503c48e4cfb8bdd1b5491f2fe4ccf67a /src | |
| parent | 41ec9a94b39dd7033c719eb89d13339dc77d9146 (diff) | |
| download | luajit-655401f3e9eb0250108c8a17bb0eddd5f192eeb2.tar.gz luajit-655401f3e9eb0250108c8a17bb0eddd5f192eeb2.tar.bz2 luajit-655401f3e9eb0250108c8a17bb0eddd5f192eeb2.zip | |
Avoid name clash with standard POSIX function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib_package.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib_package.c b/src/lib_package.c index 6d093500..5678ca4a 100644 --- a/src/lib_package.c +++ b/src/lib_package.c | |||
| @@ -170,13 +170,13 @@ static int lj_cf_package_loadlib(lua_State *L) | |||
| 170 | { | 170 | { |
| 171 | const char *path = luaL_checkstring(L, 1); | 171 | const char *path = luaL_checkstring(L, 1); |
| 172 | const char *init = luaL_checkstring(L, 2); | 172 | const char *init = luaL_checkstring(L, 2); |
| 173 | int stat = ll_loadfunc(L, path, init); | 173 | int st = ll_loadfunc(L, path, init); |
| 174 | if (stat == 0) { /* no errors? */ | 174 | if (st == 0) { /* no errors? */ |
| 175 | return 1; /* return the loaded function */ | 175 | return 1; /* return the loaded function */ |
| 176 | } else { /* error; error message is on stack top */ | 176 | } else { /* error; error message is on stack top */ |
| 177 | lua_pushnil(L); | 177 | lua_pushnil(L); |
| 178 | lua_insert(L, -2); | 178 | lua_insert(L, -2); |
| 179 | lua_pushstring(L, (stat == PACKAGE_ERR_LIB) ? PACKAGE_LIB_FAIL : "init"); | 179 | lua_pushstring(L, (st == PACKAGE_ERR_LIB) ? PACKAGE_LIB_FAIL : "init"); |
| 180 | return 3; /* return nil, error message, and where */ | 180 | return 3; /* return nil, error message, and where */ |
| 181 | } | 181 | } |
| 182 | } | 182 | } |
| @@ -279,14 +279,14 @@ static int lj_cf_package_loader_croot(lua_State *L) | |||
| 279 | const char *filename; | 279 | const char *filename; |
| 280 | const char *name = luaL_checkstring(L, 1); | 280 | const char *name = luaL_checkstring(L, 1); |
| 281 | const char *p = strchr(name, '.'); | 281 | const char *p = strchr(name, '.'); |
| 282 | int stat; | 282 | int st; |
| 283 | if (p == NULL) return 0; /* is root */ | 283 | if (p == NULL) return 0; /* is root */ |
| 284 | lua_pushlstring(L, name, (size_t)(p - name)); | 284 | lua_pushlstring(L, name, (size_t)(p - name)); |
| 285 | filename = findfile(L, lua_tostring(L, -1), "cpath"); | 285 | filename = findfile(L, lua_tostring(L, -1), "cpath"); |
| 286 | if (filename == NULL) return 1; /* root not found */ | 286 | if (filename == NULL) return 1; /* root not found */ |
| 287 | funcname = mkfuncname(L, name); | 287 | funcname = mkfuncname(L, name); |
| 288 | if ((stat = ll_loadfunc(L, filename, funcname)) != 0) { | 288 | if ((st = ll_loadfunc(L, filename, funcname)) != 0) { |
| 289 | if (stat != PACKAGE_ERR_FUNC) loaderror(L, filename); /* real error */ | 289 | if (st != PACKAGE_ERR_FUNC) loaderror(L, filename); /* real error */ |
| 290 | lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, | 290 | lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, |
| 291 | name, filename); | 291 | name, filename); |
| 292 | return 1; /* function not found */ | 292 | return 1; /* function not found */ |
