aboutsummaryrefslogtreecommitdiff
path: root/ltablib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-28 15:26:30 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-28 15:26:30 -0200
commitece042fef090fcccac0d046ad269714fa263925c (patch)
treed26f77ac5bbf186045cf33feb5a8929448b763c9 /ltablib.c
parent217b65e6d941f7ae1a615b2749d1b1d94d6da827 (diff)
downloadlua-ece042fef090fcccac0d046ad269714fa263925c.tar.gz
lua-ece042fef090fcccac0d046ad269714fa263925c.tar.bz2
lua-ece042fef090fcccac0d046ad269714fa263925c.zip
'table.pack' does not return 'n' (may be confusing when
using table.pack as last argument in a call)
Diffstat (limited to 'ltablib.c')
-rw-r--r--ltablib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ltablib.c b/ltablib.c
index c1bd5ff0..527988a5 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltablib.c,v 1.61 2011/07/05 12:49:35 roberto Exp roberto $ 2** $Id: ltablib.c,v 1.62 2011/09/30 12:45:45 roberto Exp roberto $
3** Library for Table Manipulation 3** Library for Table Manipulation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -129,8 +129,7 @@ static int pack (lua_State *L) {
129 for (i = n; i >= 2; i--) /* assign other elements */ 129 for (i = n; i >= 2; i--) /* assign other elements */
130 lua_rawseti(L, 1, i); 130 lua_rawseti(L, 1, i);
131 } 131 }
132 lua_pushinteger(L, n); 132 return 1; /* return table */
133 return 2; /* return table and number of elements */
134} 133}
135 134
136 135