aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-21 10:48:44 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-21 10:48:44 -0300
commitc67603fafba7f982e92eb870ff4da6c6433c2a85 (patch)
tree4f462d90c766a989e4a41d8bf62199554c7792ab /lstrlib.c
parent06865aa01d1a8bfcf9f2f4b5a71e37a2561eeea6 (diff)
downloadlua-c67603fafba7f982e92eb870ff4da6c6433c2a85.tar.gz
lua-c67603fafba7f982e92eb870ff4da6c6433c2a85.tar.bz2
lua-c67603fafba7f982e92eb870ff4da6c6433c2a85.zip
using new 'lua_newuserdatauv' instead of 'lua_newuserdata'
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 84b6e4eb..da9ef911 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.259 2017/11/16 13:19:06 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.260 2017/11/23 19:29:04 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -837,7 +837,7 @@ static int gmatch (lua_State *L) {
837 const char *p = luaL_checklstring(L, 2, &lp); 837 const char *p = luaL_checklstring(L, 2, &lp);
838 GMatchState *gm; 838 GMatchState *gm;
839 lua_settop(L, 2); /* keep them on closure to avoid being collected */ 839 lua_settop(L, 2); /* keep them on closure to avoid being collected */
840 gm = (GMatchState *)lua_newuserdata(L, sizeof(GMatchState)); 840 gm = (GMatchState *)lua_newuserdatauv(L, sizeof(GMatchState), 0);
841 prepstate(&gm->ms, L, s, ls, p, lp); 841 prepstate(&gm->ms, L, s, ls, p, lp);
842 gm->src = s; gm->p = p; gm->lastmatch = NULL; 842 gm->src = s; gm->p = p; gm->lastmatch = NULL;
843 lua_pushcclosure(L, gmatch_aux, 3); 843 lua_pushcclosure(L, gmatch_aux, 3);