new scheme for buffers

This commit is contained in:
Roberto Ierusalimschy
2000-09-11 14:38:42 -03:00
parent 70c8a31092
commit 787a78f83e
13 changed files with 399 additions and 234 deletions

5
ldo.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: ldo.c,v 1.92 2000/08/31 13:31:44 roberto Exp roberto $
** $Id: ldo.c,v 1.93 2000/09/04 18:52:51 roberto Exp roberto $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -293,7 +293,8 @@ static int parse_file (lua_State *L, const char *filename) {
int c; /* look ahead char */
FILE *f = (filename == NULL) ? stdin : fopen(filename, "r");
if (f == NULL) return LUA_ERRFILE; /* unable to open file */
luaL_filesource(source, filename, sizeof(source));
if (filename == NULL) filename = "(stdin)";
sprintf(source, "@%.*s", (int)sizeof(source)-2, filename);
c = fgetc(f);
ungetc(c, f);
bin = (c == ID_CHUNK);