lua

A copy of the Lua development repository
Log | Files | Refs | README

commit bf96d3fdd9ee477faa774734453c27535a36b16f
parent c8c2e06899b0a05d4af0b71ab527a930356dea08
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 19 Sep 2005 10:48:50 -0300

'string.find' as it was in 5.0

Diffstat:
Mlstrlib.c | 7+------
Mluaconf.h | 10+---------
2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/lstrlib.c b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.122 2005/08/15 14:12:32 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.123 2005/08/26 17:36:32 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -516,12 +516,7 @@ static int str_find_aux (lua_State *L, int find) { if (find) { lua_pushinteger(L, s1-s+1); /* start */ lua_pushinteger(L, res-s); /* end */ -#if defined(LUA_COMPAT_FIND) return push_captures(&ms, NULL, 0) + 2; -#else - return 2; -#endif - } else return push_captures(&ms, s1, res); diff --git a/luaconf.h b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.66 2005/09/14 17:23:03 roberto Exp roberto $ +** $Id: luaconf.h,v 1.67 2005/09/14 17:44:48 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -316,20 +316,12 @@ #define LUA_COMPAT_LSTR 1 /* -@@ LUA_COMPAT_FIND controls compatibility with old 'string.find' behavior. -** CHANGE it to undefined as soon as your programs use 'string.find' only -** to find patterns. -*/ -#define LUA_COMPAT_FIND - -/* @@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name. ** CHANGE it to undefined as soon as you rename 'string.gfind' to ** 'string.gmatch'. */ #define LUA_COMPAT_GFIND - /* @@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib' @* behavior.