瀏覽代碼

no more path for loadfile + function lists sorted

Roberto Ierusalimschy 20 年之前
父節點
當前提交
a569099b70
共有 1 個文件被更改,包括 20 次插入28 次删除
  1. 20 28
      lbaselib.c

+ 20 - 28
lbaselib.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lbaselib.c,v 1.178 2005/05/25 13:21:26 roberto Exp roberto $
+** $Id: lbaselib.c,v 1.179 2005/07/07 15:48:29 roberto Exp roberto $
 ** Basic library
 ** Basic library
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -270,15 +270,7 @@ static int luaB_loadstring (lua_State *L) {
 
 
 static int luaB_loadfile (lua_State *L) {
 static int luaB_loadfile (lua_State *L) {
   const char *fname = luaL_optstring(L, 1, NULL);
   const char *fname = luaL_optstring(L, 1, NULL);
-  const char *path = luaL_optstring(L, 2, NULL);
-  int status;
-  if (path == NULL)
-    status = luaL_loadfile(L, fname);
-  else {
-    fname = luaL_searchpath(L, fname, path);
-    status = (fname) ? luaL_loadfile(L, fname) : 1;
-  }
-  return load_aux(L, status);
+  return load_aux(L, luaL_loadfile(L, fname));
 }
 }
 
 
 
 
@@ -438,30 +430,30 @@ static int luaB_newproxy (lua_State *L) {
 
 
 
 
 static const luaL_reg base_funcs[] = {
 static const luaL_reg base_funcs[] = {
+  {"assert", luaB_assert},
+  {"collectgarbage", luaB_collectgarbage},
+  {"dofile", luaB_dofile},
   {"error", luaB_error},
   {"error", luaB_error},
-  {"getmetatable", luaB_getmetatable},
-  {"setmetatable", luaB_setmetatable},
+  {"gcinfo", luaB_gcinfo},
   {"getfenv", luaB_getfenv},
   {"getfenv", luaB_getfenv},
-  {"setfenv", luaB_setfenv},
+  {"getmetatable", luaB_getmetatable},
+  {"loadfile", luaB_loadfile},
+  {"load", luaB_load},
+  {"loadstring", luaB_loadstring},
   {"next", luaB_next},
   {"next", luaB_next},
+  {"pcall", luaB_pcall},
   {"print", luaB_print},
   {"print", luaB_print},
+  {"rawequal", luaB_rawequal},
+  {"rawget", luaB_rawget},
+  {"rawset", luaB_rawset},
+  {"select", luaB_select},
+  {"setfenv", luaB_setfenv},
+  {"setmetatable", luaB_setmetatable},
   {"tonumber", luaB_tonumber},
   {"tonumber", luaB_tonumber},
   {"tostring", luaB_tostring},
   {"tostring", luaB_tostring},
   {"type", luaB_type},
   {"type", luaB_type},
-  {"assert", luaB_assert},
   {"unpack", luaB_unpack},
   {"unpack", luaB_unpack},
-  {"select", luaB_select},
-  {"rawequal", luaB_rawequal},
-  {"rawget", luaB_rawget},
-  {"rawset", luaB_rawset},
-  {"pcall", luaB_pcall},
   {"xpcall", luaB_xpcall},
   {"xpcall", luaB_xpcall},
-  {"collectgarbage", luaB_collectgarbage},
-  {"gcinfo", luaB_gcinfo},
-  {"loadfile", luaB_loadfile},
-  {"dofile", luaB_dofile},
-  {"loadstring", luaB_loadstring},
-  {"load", luaB_load},
   {NULL, NULL}
   {NULL, NULL}
 };
 };
 
 
@@ -589,11 +581,11 @@ static int luaB_corunning (lua_State *L) {
 
 
 static const luaL_reg co_funcs[] = {
 static const luaL_reg co_funcs[] = {
   {"create", luaB_cocreate},
   {"create", luaB_cocreate},
-  {"wrap", luaB_cowrap},
   {"resume", luaB_coresume},
   {"resume", luaB_coresume},
-  {"yield", luaB_yield},
-  {"status", luaB_costatus},
   {"running", luaB_corunning},
   {"running", luaB_corunning},
+  {"status", luaB_costatus},
+  {"wrap", luaB_cowrap},
+  {"yield", luaB_yield},
   {NULL, NULL}
   {NULL, NULL}
 };
 };