diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-04-22 16:28:37 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-04-22 16:28:37 -0300 |
commit | f37e65d1cb53db19d2d18cfccd8cdd4527a557d6 (patch) | |
tree | e67639c35c2925f93074e8facfb83646b268a33a | |
parent | 0ef5cf22891c9d34a88ccc5d89eb0ed82b004471 (diff) | |
download | lua-f37e65d1cb53db19d2d18cfccd8cdd4527a557d6.tar.gz lua-f37e65d1cb53db19d2d18cfccd8cdd4527a557d6.tar.bz2 lua-f37e65d1cb53db19d2d18cfccd8cdd4527a557d6.zip |
"exit" has an optional parameter of status.
-rw-r--r-- | iolib.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -3,7 +3,7 @@ | |||
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.39 1996/03/14 15:55:18 roberto Exp roberto $"; | 6 | char *rcs_iolib="$Id: iolib.c,v 1.40 1996/03/19 22:28:37 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include <ctype.h> | 9 | #include <ctype.h> |
@@ -529,9 +529,8 @@ static void io_date (void) | |||
529 | static void io_exit (void) | 529 | static void io_exit (void) |
530 | { | 530 | { |
531 | lua_Object o = lua_getparam(1); | 531 | lua_Object o = lua_getparam(1); |
532 | if (lua_isstring(o)) | 532 | int code = lua_isnumber(o) ? (int)lua_getnumber(o) : 1; |
533 | fprintf(stderr, "%s\n", lua_getstring(o)); | 533 | exit(code); |
534 | exit(1); | ||
535 | } | 534 | } |
536 | 535 | ||
537 | /* | 536 | /* |