diff options
-rw-r--r-- | ldo.c | 4 | ||||
-rw-r--r-- | llimits.h | 8 | ||||
-rw-r--r-- | lua.c | 10 |
3 files changed, 15 insertions, 7 deletions
@@ -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 | |||
335 | int lua_dofile (lua_State *L, const char *filename) { | 333 | int lua_dofile (lua_State *L, const char *filename) { |
336 | ZIO z; | 334 | ZIO z; |
337 | int status; | 335 | int status; |
@@ -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 |
@@ -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 | ||
133 | static void manual_input (int version, int prompt) { | 137 | static 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 | } |