From da32450c3d4c8abd3fd6709692859a12a8886511 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 16 May 2005 16:21:11 -0300 Subject: new API function `lua_tolstring' --- lstrlib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index 93f8e776..502ad9b3 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.111 2005/03/22 16:54:29 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.112 2005/05/05 15:34:03 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -525,8 +525,8 @@ static int str_find (lua_State *L) { static int gfind_aux (lua_State *L) { MatchState ms; - const char *s = lua_tostring(L, lua_upvalueindex(1)); - size_t ls = lua_strlen(L, lua_upvalueindex(1)); + size_t ls; + const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls); const char *p = lua_tostring(L, lua_upvalueindex(2)); const char *src; ms.L = L; @@ -563,8 +563,8 @@ static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, const char *e) { lua_State *L = ms->L; if (lua_isstring(L, 3)) { - const char *news = lua_tostring(L, 3); - size_t l = lua_strlen(L, 3); + size_t l; + const char *news = lua_tolstring(L, 3, &l); size_t i; for (i=0; i