aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-09-07 15:59:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-09-07 15:59:59 -0300
commitce9609296ce5d761e58af4cccdab6ca925613bea (patch)
tree0613054791c3c900a651d77a678672f811b075b2 /liolib.c
parentb1450721be39b9cb7b60144ec5115e379c56de77 (diff)
downloadlua-ce9609296ce5d761e58af4cccdab6ca925613bea.tar.gz
lua-ce9609296ce5d761e58af4cccdab6ca925613bea.tar.bz2
lua-ce9609296ce5d761e58af4cccdab6ca925613bea.zip
function "luaL_argerror" prints wrong argument number (from a user's point
of view) when functions have upvalues.
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/liolib.c b/liolib.c
index 184568f7..2aba847c 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.23 1998/08/24 20:14:56 roberto Exp roberto $ 2** $Id: liolib.c,v 1.24 1998/08/30 20:25:24 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*/
@@ -284,8 +284,8 @@ static void io_seek (void) {
284 FILE *f = getfile(FIRSTARG-1+1); 284 FILE *f = getfile(FIRSTARG-1+1);
285 int op = luaL_findstring(luaL_opt_string(FIRSTARG-1+2, "cur"), modenames); 285 int op = luaL_findstring(luaL_opt_string(FIRSTARG-1+2, "cur"), modenames);
286 long offset = luaL_opt_number(FIRSTARG-1+3, 0); 286 long offset = luaL_opt_number(FIRSTARG-1+3, 0);
287 luaL_arg_check(f, 1, "invalid file handler"); 287 luaL_arg_check(f, FIRSTARG-1+1, "invalid file handler");
288 luaL_arg_check(op != -1, 2, "invalid mode"); 288 luaL_arg_check(op != -1, FIRSTARG-1+2, "invalid mode");
289 op = fseek(f, offset, mode[op]); 289 op = fseek(f, offset, mode[op]);
290 if (op) 290 if (op)
291 pushresult(0); /* error */ 291 pushresult(0); /* error */
@@ -296,7 +296,7 @@ static void io_seek (void) {
296 296
297static void io_flush (void) { 297static void io_flush (void) {
298 FILE *f = getfile(FIRSTARG); 298 FILE *f = getfile(FIRSTARG);
299 luaL_arg_check(f || lua_getparam(FIRSTARG) == LUA_NOOBJECT, 1, 299 luaL_arg_check(f || lua_getparam(FIRSTARG) == LUA_NOOBJECT, FIRSTARG,
300 "invalid file handler"); 300 "invalid file handler");
301 pushresult(fflush(f) == 0); 301 pushresult(fflush(f) == 0);
302} 302}