diff options
Diffstat (limited to '')
| -rw-r--r-- | strlib.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** String library to LUA | 3 | ** String library to LUA |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_strlib="$Id: strlib.c,v 1.29 1996/09/20 18:20:44 roberto Exp roberto $"; | 6 | char *rcs_strlib="$Id: strlib.c,v 1.30 1996/10/31 17:26:04 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <string.h> | 8 | #include <string.h> |
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| @@ -359,10 +359,10 @@ static char *match (char *s, char *p, int level) | |||
| 359 | 359 | ||
| 360 | static void str_find (void) | 360 | static void str_find (void) |
| 361 | { | 361 | { |
| 362 | char *s = lua_check_string(1, "find"); | 362 | char *s = lua_check_string(1, "strfind"); |
| 363 | char *p = lua_check_string(2, "find"); | 363 | char *p = lua_check_string(2, "strfind"); |
| 364 | long init = lua_opt_number(3, 1, "strfind") - 1; | 364 | long init = lua_opt_number(3, 1, "strfind") - 1; |
| 365 | lua_arg_check(0 <= init && init <= strlen(s), "find"); | 365 | lua_arg_check(0 <= init && init <= strlen(s), "strfind"); |
| 366 | if (lua_getparam(4) != LUA_NOOBJECT || | 366 | if (lua_getparam(4) != LUA_NOOBJECT || |
| 367 | strpbrk(p, SPECIALS) == NULL) { /* no special caracters? */ | 367 | strpbrk(p, SPECIALS) == NULL) { /* no special caracters? */ |
| 368 | char *s2 = strstr(s+init, p); | 368 | char *s2 = strstr(s+init, p); |
| @@ -415,7 +415,7 @@ static void add_s (lua_Object newp) | |||
| 415 | addstr(lua_isstring(res) ? lua_getstring(res) : ""); | 415 | addstr(lua_isstring(res) ? lua_getstring(res) : ""); |
| 416 | lua_endblock(); | 416 | lua_endblock(); |
| 417 | } | 417 | } |
| 418 | else lua_error("incorrect argument to `gsub'"); | 418 | else lua_arg_check(0, "gsub"); |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | static void str_gsub (void) | 421 | static void str_gsub (void) |
