'main' returns condition code

This commit is contained in:
Roberto Ierusalimschy 1994-11-28 15:12:49 -02:00
parent 2b301d711b
commit 0f580df73c
1 changed files with 6 additions and 4 deletions

10
lua.c
View File

@ -3,7 +3,7 @@
** Linguagem para Usuarios de Aplicacao
*/
char *rcs_lua="$Id: $";
char *rcs_lua="$Id: lua.c,v 1.1 1993/12/17 18:41:19 celes Stab roberto $";
#include <stdio.h>
@ -11,9 +11,10 @@ char *rcs_lua="$Id: $";
#include "lualib.h"
void main (int argc, char *argv[])
int main (int argc, char *argv[])
{
int i;
int result = 0;
iolib_open ();
strlib_open ();
mathlib_open ();
@ -21,11 +22,12 @@ void main (int argc, char *argv[])
{
char buffer[250];
while (gets(buffer) != 0)
lua_dostring(buffer);
result = lua_dostring(buffer);
}
else
for (i=1; i<argc; i++)
lua_dofile (argv[i]);
result = lua_dofile (argv[i]);
return result;
}