aboutsummaryrefslogtreecommitdiff
path: root/inout.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-05-02 15:43:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-05-02 15:43:03 -0300
commit18ea2eff80c720632cb6a89d560c5cce2377df06 (patch)
tree67fc3acd282d134099b2f92657e191baeaff1277 /inout.c
parent8156604823aa487f4436d33fe89302598faab3db (diff)
downloadlua-18ea2eff80c720632cb6a89d560c5cce2377df06.tar.gz
lua-18ea2eff80c720632cb6a89d560c5cce2377df06.tar.bz2
lua-18ea2eff80c720632cb6a89d560c5cce2377df06.zip
calls to "lua_reportbug" changed to "lua_error", since
"lua_reportbug" is only an internal function to build debug information
Diffstat (limited to 'inout.c')
-rw-r--r--inout.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/inout.c b/inout.c
index b6c4e768..9ea0fd82 100644
--- a/inout.c
+++ b/inout.c
@@ -5,7 +5,7 @@
5** Also provides some predefined lua functions. 5** Also provides some predefined lua functions.
6*/ 6*/
7 7
8char *rcs_inout="$Id: inout.c,v 2.17 1995/03/17 20:27:11 celes Exp roberto $"; 8char *rcs_inout="$Id: inout.c,v 2.18 1995/03/17 20:42:20 roberto Exp roberto $";
9 9
10#include <stdio.h> 10#include <stdio.h>
11#include <stdlib.h> 11#include <stdlib.h>
@@ -26,11 +26,7 @@ Word lua_debugline = 0;
26 26
27 27
28/* Internal variables */ 28/* Internal variables */
29 29
30#ifndef MAXFUNCSTACK
31#define MAXFUNCSTACK 100
32#endif
33
34typedef struct FuncStackNode { 30typedef struct FuncStackNode {
35 struct FuncStackNode *next; 31 struct FuncStackNode *next;
36 char *file; 32 char *file;
@@ -124,7 +120,7 @@ void lua_pushfunction (char *file, Word function)
124 FuncStackNode *newNode; 120 FuncStackNode *newNode;
125 if (nfuncstack++ >= MAXFUNCSTACK) 121 if (nfuncstack++ >= MAXFUNCSTACK)
126 { 122 {
127 lua_reportbug("function stack overflow"); 123 lua_error("function stack overflow");
128 } 124 }
129 newNode = new(FuncStackNode); 125 newNode = new(FuncStackNode);
130 newNode->function = function; 126 newNode->function = function;
@@ -149,12 +145,10 @@ void lua_popfunction (void)
149} 145}
150 146
151/* 147/*
152** Report bug building a message and sending it to lua_error function. 148** Report bug building a message.
153*/ 149*/
154void lua_reportbug (char *s) 150void luaI_reportbug (char *msg, int size)
155{ 151{
156 char msg[MAXFUNCSTACK*80];
157 strcpy (msg, s);
158 if (lua_debugline != 0) 152 if (lua_debugline != 0)
159 { 153 {
160 if (funcStack) 154 if (funcStack)
@@ -179,7 +173,6 @@ void lua_reportbug (char *s)
179 lua_debugline, lua_filename()); 173 lua_debugline, lua_filename());
180 } 174 }
181 } 175 }
182 lua_error (msg);
183} 176}
184 177
185 178
@@ -292,6 +285,6 @@ void luaI_error (void)
292{ 285{
293 char *s = lua_getstring(lua_getparam(1)); 286 char *s = lua_getstring(lua_getparam(1));
294 if (s == NULL) s = "(no message)"; 287 if (s == NULL) s = "(no message)";
295 lua_reportbug(s); 288 lua_error(s);
296} 289}
297 290