aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-15 13:44:36 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-15 13:44:36 -0300
commita1d8eb27431c02c4529be1efd92143ad65434f3a (patch)
tree58db9340ba2b8ea1cb91004b96f15a955f167c58 /lbaselib.c
parentf64a1b175a5fa65434a073e6d071b32bb7b0ab69 (diff)
downloadlua-a1d8eb27431c02c4529be1efd92143ad65434f3a.tar.gz
lua-a1d8eb27431c02c4529be1efd92143ad65434f3a.tar.bz2
lua-a1d8eb27431c02c4529be1efd92143ad65434f3a.zip
Added control messages to warnings
Added the concept of control messages to the warning system, plus the implementation of the controls "@on"/"@off" to turn warnings on/off. Moreover, the warning system in the test library adds some other controls to ease the test of warnings.
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 4724e759..c68e6d38 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -48,9 +48,9 @@ static int luaB_warn (lua_State *L) {
48 luaL_checkstring(L, 1); /* at least one argument */ 48 luaL_checkstring(L, 1); /* at least one argument */
49 for (i = 2; i <= n; i++) 49 for (i = 2; i <= n; i++)
50 luaL_checkstring(L, i); /* make sure all arguments are strings */ 50 luaL_checkstring(L, i); /* make sure all arguments are strings */
51 for (i = 1; i <= n; i++) /* compose warning */ 51 for (i = 1; i < n; i++) /* compose warning */
52 lua_warning(L, lua_tostring(L, i), 1); 52 lua_warning(L, lua_tostring(L, i), 1);
53 lua_warning(L, "", 0); /* close warning */ 53 lua_warning(L, lua_tostring(L, n), 0); /* close warning */
54 return 0; 54 return 0;
55} 55}
56 56