From f37e65d1cb53db19d2d18cfccd8cdd4527a557d6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 22 Apr 1996 16:28:37 -0300 Subject: "exit" has an optional parameter of status. --- iolib.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/iolib.c b/iolib.c index a6ae51bd..e5b175bf 100644 --- a/iolib.c +++ b/iolib.c @@ -3,7 +3,7 @@ ** Input/output library to LUA */ -char *rcs_iolib="$Id: iolib.c,v 1.39 1996/03/14 15:55:18 roberto Exp roberto $"; +char *rcs_iolib="$Id: iolib.c,v 1.40 1996/03/19 22:28:37 roberto Exp roberto $"; #include #include @@ -529,9 +529,8 @@ static void io_date (void) static void io_exit (void) { lua_Object o = lua_getparam(1); - if (lua_isstring(o)) - fprintf(stderr, "%s\n", lua_getstring(o)); - exit(1); + int code = lua_isnumber(o) ? (int)lua_getnumber(o) : 1; + exit(code); } /* -- cgit v1.2.3-55-g6feb