diff options
| -rw-r--r-- | iolib.c | 5 | ||||
| -rw-r--r-- | lua.c | 10 |
2 files changed, 11 insertions, 4 deletions
| @@ -3,11 +3,10 @@ | |||
| 3 | ** Input/output library to LUA | 3 | ** Input/output library to LUA |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_iolib="$Id: iolib.c,v 1.42 1996/04/23 12:43:07 roberto Exp roberto $"; | 6 | char *rcs_iolib="$Id: iolib.c,v 1.43 1996/04/30 21:13:55 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <stdio.h> | 8 | #include <stdio.h> |
| 9 | #include <ctype.h> | 9 | #include <ctype.h> |
| 10 | #include <sys/types.h> | ||
| 11 | #include <string.h> | 10 | #include <string.h> |
| 12 | #include <time.h> | 11 | #include <time.h> |
| 13 | #include <stdlib.h> | 12 | #include <stdlib.h> |
| @@ -546,7 +545,7 @@ static void io_debug (void) | |||
| 546 | } | 545 | } |
| 547 | 546 | ||
| 548 | 547 | ||
| 549 | void lua_printstack (FILE *f) | 548 | static void lua_printstack (FILE *f) |
| 550 | { | 549 | { |
| 551 | int level = 0; | 550 | int level = 0; |
| 552 | lua_Object func; | 551 | lua_Object func; |
| @@ -3,7 +3,7 @@ | |||
| 3 | ** Linguagem para Usuarios de Aplicacao | 3 | ** Linguagem para Usuarios de Aplicacao |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_lua="$Id: lua.c,v 1.8 1996/03/12 13:14:52 roberto Exp roberto $"; | 6 | char *rcs_lua="$Id: lua.c,v 1.9 1996/04/23 12:43:07 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <stdio.h> | 8 | #include <stdio.h> |
| 9 | #include <string.h> | 9 | #include <string.h> |
| @@ -14,11 +14,15 @@ char *rcs_lua="$Id: lua.c,v 1.8 1996/03/12 13:14:52 roberto Exp roberto $"; | |||
| 14 | static int lua_argc; | 14 | static int lua_argc; |
| 15 | static char **lua_argv; | 15 | static char **lua_argv; |
| 16 | 16 | ||
| 17 | #ifdef POSIX | ||
| 17 | /* | 18 | /* |
| 18 | ** although this function is POSIX, there is no standard header file that | 19 | ** although this function is POSIX, there is no standard header file that |
| 19 | ** defines it | 20 | ** defines it |
| 20 | */ | 21 | */ |
| 21 | int isatty (int fd); | 22 | int isatty (int fd); |
| 23 | #else | ||
| 24 | #define isatty(x) (x==0) /* assume stdin is a tty */ | ||
| 25 | #endif | ||
| 22 | 26 | ||
| 23 | /* | 27 | /* |
| 24 | %F Allow Lua code to access argv strings. | 28 | %F Allow Lua code to access argv strings. |
| @@ -83,7 +87,11 @@ int main (int argc, char *argv[]) | |||
| 83 | printf("%s %s\n(written by %s)\n\n", | 87 | printf("%s %s\n(written by %s)\n\n", |
| 84 | LUA_VERSION, LUA_COPYRIGHT, LUA_AUTHORS); | 88 | LUA_VERSION, LUA_COPYRIGHT, LUA_AUTHORS); |
| 85 | else | 89 | else |
| 90 | { | ||
| 86 | result = lua_dofile (argv[i]); | 91 | result = lua_dofile (argv[i]); |
| 92 | if (result) | ||
| 93 | fprintf(stderr, "lua: error trying to run file %s\n", argv[i]); | ||
| 94 | } | ||
| 87 | } | 95 | } |
| 88 | } | 96 | } |
| 89 | return result; | 97 | return result; |
