diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-08 20:39:36 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-08 20:39:36 -0200 |
commit | 87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1 (patch) | |
tree | f887a310dfb777403129a9520af3560fe3b85804 /lstrlib.c | |
parent | cb50fcf42d9ab2d04f6f28a30a0ca5cc6e58054c (diff) | |
download | lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.tar.gz lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.tar.bz2 lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.zip |
no more `lua_istrue' function
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); |