Final touhes.
authorAlexey Zaytsev <alexey.zaytsev@gmail.com>
Thu, 17 Jul 2008 23:27:36 +0000 (03:27 +0400)
committerAlexey Zaytsev <zaytsev.a@protei.ru>
Thu, 17 Jul 2008 23:27:36 +0000 (03:27 +0400)
Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
com32/lua/src/loslib.c
com32/lua/src/lua.c
com32/lua/src/lua.h

index 81b57eb..740ad0d 100644 (file)
@@ -66,7 +66,7 @@ static int os_tmpname (lua_State *L) {
 
 
 static int os_getenv (lua_State *L) {
-  lua_pushstring(L, getenv(luaL_checkstring(L, 1)));  /* if NULL push nil */
+  lua_pushstring(L, /*getenv(luaL_checkstring(L, 1))*/);  /* if NULL push nil */
   return 1;
 }
 
index 7df2c3f..0d2d16c 100644 (file)
@@ -10,6 +10,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <console.h>
 #define lua_c
 
 #include "lua.h"
@@ -321,7 +322,7 @@ static int runargs (lua_State *L, char **argv, int n) {
 
 
 static int handle_luainit (lua_State *L) {
-  const char *init = getenv(LUA_INIT);
+  const char *init = /*getenv(LUA_INIT)*/ NULL;
   if (init == NULL) return 0;  /* status OK */
   else if (init[0] == '@')
     return dofile(L, init+1);
@@ -377,6 +378,9 @@ static int pmain (lua_State *L) {
 int main (int argc, char **argv) {
   int status;
   struct Smain s;
+
+  openconsole(&dev_stdcon_r, &dev_stdcon_w);
+
   lua_State *L = lua_open();  /* create state */
   if (L == NULL) {
     l_message(argv[0], "cannot create state: not enough memory");
index 5bc97b7..3b325a9 100644 (file)
@@ -15,6 +15,9 @@
 
 #include "luaconf.h"
 
+#define feof(x) 0
+#define ferror(x) 0
+
 
 #define LUA_VERSION    "Lua 5.1"
 #define LUA_RELEASE    "Lua 5.1.3"