aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ldo.c b/ldo.c
index a06fa138..1fd993c7 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.92 2000/08/31 13:31:44 roberto Exp roberto $ 2** $Id: ldo.c,v 1.93 2000/09/04 18:52:51 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*/
@@ -293,7 +293,8 @@ static int parse_file (lua_State *L, const char *filename) {
293 int c; /* look ahead char */ 293 int c; /* look ahead char */
294 FILE *f = (filename == NULL) ? stdin : fopen(filename, "r"); 294 FILE *f = (filename == NULL) ? stdin : fopen(filename, "r");
295 if (f == NULL) return LUA_ERRFILE; /* unable to open file */ 295 if (f == NULL) return LUA_ERRFILE; /* unable to open file */
296 luaL_filesource(source, filename, sizeof(source)); 296 if (filename == NULL) filename = "(stdin)";
297 sprintf(source, "@%.*s", (int)sizeof(source)-2, filename);
297 c = fgetc(f); 298 c = fgetc(f);
298 ungetc(c, f); 299 ungetc(c, f);
299 bin = (c == ID_CHUNK); 300 bin = (c == ID_CHUNK);