lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

The presence of string.gfind in Lua 5.2.0 seems an anachronism.
The attached patch removes it.

François
From 9f8a9295849874e8b4f9fb140a5f2ef594b7f7cc Mon Sep 17 00:00:00 2001
From: Francois Perrad <francois.perrad@gadz.org>
Date: Fri, 19 Nov 2010 15:39:45 +0100
Subject: [PATCH] remove gfind

---
 src/lstrlib.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/src/lstrlib.c b/src/lstrlib.c
index 82c2005..4306b49 100644
--- a/src/lstrlib.c
+++ b/src/lstrlib.c
@@ -614,12 +614,6 @@ static int gmatch (lua_State *L) {
 }
 
 
-static int gfind_nodef (lua_State *L) {
-  return luaL_error(L, LUA_QL("string.gfind") " was renamed to "
-                       LUA_QL("string.gmatch"));
-}
-
-
 static void add_s (MatchState *ms, luaL_Buffer *b, const char *s,
                                                    const char *e) {
   size_t l, i;
@@ -912,7 +906,6 @@ static const luaL_Reg strlib[] = {
   {"dump", str_dump},
   {"find", str_find},
   {"format", str_format},
-  {"gfind", gfind_nodef},
   {"gmatch", gmatch},
   {"gsub", str_gsub},
   {"len", str_len},
-- 
1.7.1