From 852d9a859733ebf7322474c05244105e4f2748a2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 3 Nov 1994 19:48:36 -0200 Subject: function 'lua_addfile' returns an error message --- table.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'table.c') diff --git a/table.c b/table.c index 96728d95..26149d1a 100644 --- a/table.c +++ b/table.c @@ -3,7 +3,7 @@ ** Module to control static tables */ -char *rcs_table="$Id: table.c,v 2.7 1994/11/02 19:09:23 roberto Exp roberto $"; +char *rcs_table="$Id: table.c,v 2.8 1994/11/02 20:29:09 roberto Exp roberto $"; #include #include @@ -233,21 +233,15 @@ char *lua_createstring (char *s) /* ** Add a file name at file table, checking overflow. This function also set ** the external variable "lua_filename" with the function filename set. -** Return 0 on success or 1 on error. +** Return 0 on success or error message on error. */ -int lua_addfile (char *fn) +char *lua_addfile (char *fn) { if (lua_nfile >= MAXFILE-1) - { - lua_error ("too many files"); - return 1; - } + return "too many files"; if ((lua_file[lua_nfile++] = strdup (fn)) == NULL) - { - lua_error ("not enough memory"); - return 1; - } - return 0; + return "not enough memory"; + return NULL; } /* -- cgit v1.2.3-55-g6feb