diff options
-rw-r--r-- | bugs | 5 | ||||
-rw-r--r-- | lstrlib.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -170,3 +170,8 @@ in the following platforms: | |||
170 | * IRIX - cc, cc-purify | 170 | * IRIX - cc, cc-purify |
171 | * Windows - Visual C++ (.c e .cpp, warning level=4) | 171 | * Windows - Visual C++ (.c e .cpp, warning level=4) |
172 | 172 | ||
173 | |||
174 | ** lstrlib.c | ||
175 | Tue May 2 15:27:58 EST 2000 | ||
176 | >> `strfind' gets wrong subject length when there is an offset | ||
177 | (by Jon Kleiser; since 4.0a) | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.40 2000/02/08 16:34:31 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.41 2000/03/03 14:58:26 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 | */ |
@@ -405,7 +405,7 @@ static void str_find (lua_State *L) { | |||
405 | luaL_arg_check(L, 0 <= init && init <= l1, 3, "out of range"); | 405 | luaL_arg_check(L, 0 <= init && init <= l1, 3, "out of range"); |
406 | if (lua_getparam(L, 4) != LUA_NOOBJECT || | 406 | if (lua_getparam(L, 4) != LUA_NOOBJECT || |
407 | strpbrk(p, SPECIALS) == NULL) { /* no special characters? */ | 407 | strpbrk(p, SPECIALS) == NULL) { /* no special characters? */ |
408 | const char *s2 = memfind(s+init, l1, p, l2); | 408 | const char *s2 = memfind(s+init, l1-init, p, l2); |
409 | if (s2) { | 409 | if (s2) { |
410 | lua_pushnumber(L, s2-s+1); | 410 | lua_pushnumber(L, s2-s+1); |
411 | lua_pushnumber(L, s2-s+l2); | 411 | lua_pushnumber(L, s2-s+l2); |