From a1e41e3a12de258c88bca774102304e24ca29018 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 31 Oct 1996 18:18:05 -0200 Subject: small corrections in error messages --- strlib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'strlib.c') diff --git a/strlib.c b/strlib.c index 7000bdc2..1277bb12 100644 --- a/strlib.c +++ b/strlib.c @@ -3,7 +3,7 @@ ** String library to LUA */ -char *rcs_strlib="$Id: strlib.c,v 1.29 1996/09/20 18:20:44 roberto Exp roberto $"; +char *rcs_strlib="$Id: strlib.c,v 1.30 1996/10/31 17:26:04 roberto Exp roberto $"; #include #include @@ -359,10 +359,10 @@ static char *match (char *s, char *p, int level) static void str_find (void) { - char *s = lua_check_string(1, "find"); - char *p = lua_check_string(2, "find"); + char *s = lua_check_string(1, "strfind"); + char *p = lua_check_string(2, "strfind"); long init = lua_opt_number(3, 1, "strfind") - 1; - lua_arg_check(0 <= init && init <= strlen(s), "find"); + lua_arg_check(0 <= init && init <= strlen(s), "strfind"); if (lua_getparam(4) != LUA_NOOBJECT || strpbrk(p, SPECIALS) == NULL) { /* no special caracters? */ char *s2 = strstr(s+init, p); @@ -415,7 +415,7 @@ static void add_s (lua_Object newp) addstr(lua_isstring(res) ? lua_getstring(res) : ""); lua_endblock(); } - else lua_error("incorrect argument to `gsub'"); + else lua_arg_check(0, "gsub"); } static void str_gsub (void) -- cgit v1.2.3-55-g6feb