diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-03-11 15:59:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-03-11 15:59:19 -0300 |
commit | 82ad0d57705dd3be41081118781762b72e334f1b (patch) | |
tree | 6913717d8034552944758a3275649550caeaadd0 | |
parent | 256d1bea08ca12890372c6c53fc191e7b90c5a8e (diff) | |
download | lua-82ad0d57705dd3be41081118781762b72e334f1b.tar.gz lua-82ad0d57705dd3be41081118781762b72e334f1b.tar.bz2 lua-82ad0d57705dd3be41081118781762b72e334f1b.zip |
details
-rw-r--r-- | lauxlib.c | 8 | ||||
-rw-r--r-- | ldo.c | 6 | ||||
-rw-r--r-- | liolib.c | 4 | ||||
-rw-r--r-- | llex.c | 4 |
4 files changed, 10 insertions, 12 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.15 1999/03/04 21:17:26 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.16 1999/03/10 14:19:41 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -128,8 +128,6 @@ void luaL_chunkid (char *out, char *source, int len) { | |||
128 | 128 | ||
129 | 129 | ||
130 | void luaL_filesource (char *out, char *filename, int len) { | 130 | void luaL_filesource (char *out, char *filename, int len) { |
131 | if (filename == NULL) | 131 | if (filename == NULL) filename = "(stdin)"; |
132 | strcpy(out, "@(stdin)"); | 132 | sprintf(out, "@%.*s", len-2, filename); /* -2 for '@' and '\0' */ |
133 | else | ||
134 | sprintf(out, "@%.*s", len-2, filename); /* -2 for '@' and '\0' */ | ||
135 | } | 133 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.39 1999/03/10 14:19:41 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.40 1999/03/10 14:23:07 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 | */ |
@@ -356,7 +356,7 @@ void luaD_gcIM (TObject *o) | |||
356 | } | 356 | } |
357 | 357 | ||
358 | 358 | ||
359 | #define MAXFILENAME 200 /* maximum part of a file name kept */ | 359 | #define MAXFILENAME 260 /* maximum part of a file name kept */ |
360 | 360 | ||
361 | int lua_dofile (char *filename) { | 361 | int lua_dofile (char *filename) { |
362 | ZIO z; | 362 | ZIO z; |
@@ -372,7 +372,7 @@ int lua_dofile (char *filename) { | |||
372 | bin = (c == ID_CHUNK); | 372 | bin = (c == ID_CHUNK); |
373 | if (bin) | 373 | if (bin) |
374 | f = freopen(filename, "rb", f); /* set binary mode */ | 374 | f = freopen(filename, "rb", f); /* set binary mode */ |
375 | luaL_filesource(source, filename, MAXFILENAME); | 375 | luaL_filesource(source, filename, sizeof(source)); |
376 | luaZ_Fopen(&z, f, source); | 376 | luaZ_Fopen(&z, f, source); |
377 | status = do_main(&z, bin); | 377 | status = do_main(&z, bin); |
378 | if (f != stdin) | 378 | if (f != stdin) |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 1.32 1999/03/04 21:17:26 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 1.33 1999/03/05 20:45:01 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -471,7 +471,7 @@ static void errorfb (void) { | |||
471 | char buffchunk[MAXSRC]; | 471 | char buffchunk[MAXSRC]; |
472 | int linedefined; | 472 | int linedefined; |
473 | lua_funcinfo(func, &chunkname, &linedefined); | 473 | lua_funcinfo(func, &chunkname, &linedefined); |
474 | luaL_chunkid(buffchunk, chunkname, MAXSRC); | 474 | luaL_chunkid(buffchunk, chunkname, sizeof(buffchunk)); |
475 | if (level == 2) strcat(buff, "Active Stack:\n"); | 475 | if (level == 2) strcat(buff, "Active Stack:\n"); |
476 | strcat(buff, "\t"); | 476 | strcat(buff, "\t"); |
477 | if (strlen(buff) > MAXMESSAGE-MESSAGESIZE) { | 477 | if (strlen(buff) > MAXMESSAGE-MESSAGESIZE) { |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 1.31 1999/03/04 21:17:26 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.32 1999/03/05 20:45:01 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -45,7 +45,7 @@ void luaX_init (void) { | |||
45 | 45 | ||
46 | void luaX_syntaxerror (LexState *ls, char *s, char *token) { | 46 | void luaX_syntaxerror (LexState *ls, char *s, char *token) { |
47 | char buff[MAXSRC]; | 47 | char buff[MAXSRC]; |
48 | luaL_chunkid(buff, zname(ls->lex_z), MAXSRC); | 48 | luaL_chunkid(buff, zname(ls->lex_z), sizeof(buff)); |
49 | if (token[0] == '\0') | 49 | if (token[0] == '\0') |
50 | token = "<eof>"; | 50 | token = "<eof>"; |
51 | luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.50s", | 51 | luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.50s", |