diff options
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -154,12 +154,12 @@ static int str_char (lua_State *L) { | |||
154 | typedef struct MatchState { | 154 | typedef struct MatchState { |
155 | const char *src_init; /* init of source string */ | 155 | const char *src_init; /* init of source string */ |
156 | const char *src_end; /* end (`\0') of source string */ | 156 | const char *src_end; /* end (`\0') of source string */ |
157 | lua_State *L; | ||
157 | int level; /* total number of captures (finished or unfinished) */ | 158 | int level; /* total number of captures (finished or unfinished) */ |
158 | struct { | 159 | struct { |
159 | const char *init; | 160 | const char *init; |
160 | sint32 len; | 161 | sint32 len; |
161 | } capture[MAX_CAPTURES]; | 162 | } capture[MAX_CAPTURES]; |
162 | lua_State *L; | ||
163 | } MatchState; | 163 | } MatchState; |
164 | 164 | ||
165 | 165 | ||
@@ -449,7 +449,7 @@ static int str_find (lua_State *L) { | |||
449 | const char *p = luaL_check_lstr(L, 2, &l2); | 449 | const char *p = luaL_check_lstr(L, 2, &l2); |
450 | sint32 init = posrelat(luaL_opt_long(L, 3, 1), l1) - 1; | 450 | sint32 init = posrelat(luaL_opt_long(L, 3, 1), l1) - 1; |
451 | luaL_arg_check(L, 0 <= init && (size_t)(init) <= l1, 3, "out of range"); | 451 | luaL_arg_check(L, 0 <= init && (size_t)(init) <= l1, 3, "out of range"); |
452 | if (lua_istrue(L, 4) || /* explicit request? */ | 452 | if (lua_toboolean(L, 4) || /* explicit request? */ |
453 | strpbrk(p, SPECIALS) == NULL) { /* or no special characters? */ | 453 | strpbrk(p, SPECIALS) == NULL) { /* or no special characters? */ |
454 | /* do a plain search */ | 454 | /* do a plain search */ |
455 | const char *s2 = lmemfind(s+init, l1-init, p, l2); | 455 | const char *s2 = lmemfind(s+init, l1-init, p, l2); |