浏览代码

Avoid name clash with standard POSIX function.

Mike Pall 15 年之前
父节点
当前提交
655401f3e9
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/lib_package.c

+ 6 - 6
src/lib_package.c

@@ -170,13 +170,13 @@ static int lj_cf_package_loadlib(lua_State *L)
 {
   const char *path = luaL_checkstring(L, 1);
   const char *init = luaL_checkstring(L, 2);
-  int stat = ll_loadfunc(L, path, init);
-  if (stat == 0) {  /* no errors? */
+  int st = ll_loadfunc(L, path, init);
+  if (st == 0) {  /* no errors? */
     return 1;  /* return the loaded function */
   } else {  /* error; error message is on stack top */
     lua_pushnil(L);
     lua_insert(L, -2);
-    lua_pushstring(L, (stat == PACKAGE_ERR_LIB) ?  PACKAGE_LIB_FAIL : "init");
+    lua_pushstring(L, (st == PACKAGE_ERR_LIB) ?  PACKAGE_LIB_FAIL : "init");
     return 3;  /* return nil, error message, and where */
   }
 }
@@ -279,14 +279,14 @@ static int lj_cf_package_loader_croot(lua_State *L)
   const char *filename;
   const char *name = luaL_checkstring(L, 1);
   const char *p = strchr(name, '.');
-  int stat;
+  int st;
   if (p == NULL) return 0;  /* is root */
   lua_pushlstring(L, name, (size_t)(p - name));
   filename = findfile(L, lua_tostring(L, -1), "cpath");
   if (filename == NULL) return 1;  /* root not found */
   funcname = mkfuncname(L, name);
-  if ((stat = ll_loadfunc(L, filename, funcname)) != 0) {
-    if (stat != PACKAGE_ERR_FUNC) loaderror(L, filename);  /* real error */
+  if ((st = ll_loadfunc(L, filename, funcname)) != 0) {
+    if (st != PACKAGE_ERR_FUNC) loaderror(L, filename);  /* real error */
     lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS,
 		    name, filename);
     return 1;  /* function not found */