aboutsummaryrefslogtreecommitdiff
path: root/src/lj_load.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_load.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_load.c b/src/lj_load.c
index 152ef6da..fa6ed5bf 100644
--- a/src/lj_load.c
+++ b/src/lj_load.c
@@ -102,12 +102,13 @@ LUALIB_API int luaL_loadfilex(lua_State *L, const char *filename,
102 int status; 102 int status;
103 const char *chunkname; 103 const char *chunkname;
104 if (filename) { 104 if (filename) {
105 chunkname = lua_pushfstring(L, "@%s", filename);
105 ctx.fp = fopen(filename, "rb"); 106 ctx.fp = fopen(filename, "rb");
106 if (ctx.fp == NULL) { 107 if (ctx.fp == NULL) {
108 L->top--;
107 lua_pushfstring(L, "cannot open %s: %s", filename, strerror(errno)); 109 lua_pushfstring(L, "cannot open %s: %s", filename, strerror(errno));
108 return LUA_ERRFILE; 110 return LUA_ERRFILE;
109 } 111 }
110 chunkname = lua_pushfstring(L, "@%s", filename);
111 } else { 112 } else {
112 ctx.fp = stdin; 113 ctx.fp = stdin;
113 chunkname = "=stdin"; 114 chunkname = "=stdin";