From 9d0044ce53809189ccb66c1c42e722b7dc94f46a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 31 Oct 1996 15:26:04 -0200 Subject: "strfind" has an extra parameter to turn off all special characteres. --- strlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/strlib.c b/strlib.c index 78c6012c..7000bdc2 100644 --- a/strlib.c +++ b/strlib.c @@ -3,7 +3,7 @@ ** String library to LUA */ -char *rcs_strlib="$Id: strlib.c,v 1.28 1996/09/16 18:02:40 roberto Exp roberto $"; +char *rcs_strlib="$Id: strlib.c,v 1.29 1996/09/20 18:20:44 roberto Exp roberto $"; #include #include @@ -363,7 +363,8 @@ static void str_find (void) char *p = lua_check_string(2, "find"); long init = lua_opt_number(3, 1, "strfind") - 1; lua_arg_check(0 <= init && init <= strlen(s), "find"); - if (strpbrk(p, SPECIALS) == NULL) { /* no special caracters? */ + if (lua_getparam(4) != LUA_NOOBJECT || + strpbrk(p, SPECIALS) == NULL) { /* no special caracters? */ char *s2 = strstr(s+init, p); if (s2) { lua_pushnumber(s2-s+1); -- cgit v1.2.3-55-g6feb