[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Patch for lua-5.2.0-beta-rc2
- From: François Perrad <francois.perrad@...>
- Date: Fri, 24 Jun 2011 15:24:31 +0200
a minor improvement/optimization of setpath().
François
diff --git a/src/loadlib.c b/src/loadlib.c
index ce3c2e6..a7f1cfb 100644
--- a/src/loadlib.c
+++ b/src/loadlib.c
@@ -599,8 +599,8 @@ static void setpath (lua_State *L, const char *fieldname, const char *envname1,
/* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP,
LUA_PATH_SEP AUXMARK LUA_PATH_SEP);
+ lua_remove(L, -1);
luaL_gsub(L, path, AUXMARK, def);
- lua_remove(L, -2);
}
setprogdir(L);
lua_setfield(L, -2, fieldname);