aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-16 14:16:34 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-16 14:16:34 -0300
commite3ea307434c876f561fa22d22d64ec1030f10415 (patch)
treeee6448cd9a5c78b6e54a04a589e6377fcccaf522
parent18b0e8270de991556460c57b1e3d88b2df5965fc (diff)
downloadlua-e3ea307434c876f561fa22d22d64ec1030f10415.tar.gz
lua-e3ea307434c876f561fa22d22d64ec1030f10415.tar.bz2
lua-e3ea307434c876f561fa22d22d64ec1030f10415.zip
small changes to allow redefinition of some buffer sizes.
-rw-r--r--ldo.c4
-rw-r--r--llimits.h8
-rw-r--r--lua.c10
3 files changed, 15 insertions, 7 deletions
diff --git a/ldo.c b/ldo.c
index 2d62c777..6f04c374 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.77 2000/05/30 19:00:31 roberto Exp roberto $ 2** $Id: ldo.c,v 1.78 2000/06/12 13:52:05 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -330,8 +330,6 @@ static int do_main (lua_State *L, ZIO *z, int bin) {
330} 330}
331 331
332 332
333#define MAXFILENAME 260 /* maximum part of a file name kept */
334
335int lua_dofile (lua_State *L, const char *filename) { 333int lua_dofile (lua_State *L, const char *filename) {
336 ZIO z; 334 ZIO z;
337 int status; 335 int status;
diff --git a/llimits.h b/llimits.h
index af78be30..146ae73d 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llimits.h,v 1.8 2000/05/26 14:04:04 roberto Exp roberto $ 2** $Id: llimits.h,v 1.9 2000/06/06 16:27:11 roberto Exp roberto $
3** Limits, basic types, and some other "instalation-dependent" definitions 3** Limits, basic types, and some other "instalation-dependent" definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -185,4 +185,10 @@ typedef unsigned long Instruction;
185#endif 185#endif
186 186
187 187
188/* maximum part of a file name kept for error messages */
189#ifndef MAXFILENAME
190#define MAXFILENAME 260
191#endif
192
193
188#endif 194#endif
diff --git a/lua.c b/lua.c
index 8c4ef826..0affee0e 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.38 2000/05/10 17:00:21 roberto Exp roberto $ 2** $Id: lua.c,v 1.39 2000/06/12 13:52:05 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -129,12 +129,16 @@ static void file_input (const char *argv) {
129 } 129 }
130} 130}
131 131
132/* maximum length of an input string */
133#ifndef MAXINPUT
134#define MAXINPUT BUFSIZ
135#endif
132 136
133static void manual_input (int version, int prompt) { 137static void manual_input (int version, int prompt) {
134 int cont = 1; 138 int cont = 1;
135 if (version) print_version(); 139 if (version) print_version();
136 while (cont) { 140 while (cont) {
137 char buffer[BUFSIZ]; 141 char buffer[MAXINPUT];
138 int i = 0; 142 int i = 0;
139 lua_beginblock(); 143 lua_beginblock();
140 if (prompt) { 144 if (prompt) {
@@ -153,7 +157,7 @@ static void manual_input (int version, int prompt) {
153 buffer[i-1] = '\n'; 157 buffer[i-1] = '\n';
154 else break; 158 else break;
155 } 159 }
156 else if (i >= BUFSIZ-1) { 160 else if (i >= MAXINPUT-1) {
157 fprintf(stderr, "lua: input line too long\n"); 161 fprintf(stderr, "lua: input line too long\n");
158 break; 162 break;
159 } 163 }