aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-10-31 18:18:05 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-10-31 18:18:05 -0200
commita1e41e3a12de258c88bca774102304e24ca29018 (patch)
treed8d210a653419e52e77c7d2e0743e5e2f36ffddc
parent9d0044ce53809189ccb66c1c42e722b7dc94f46a (diff)
downloadlua-a1e41e3a12de258c88bca774102304e24ca29018.tar.gz
lua-a1e41e3a12de258c88bca774102304e24ca29018.tar.bz2
lua-a1e41e3a12de258c88bca774102304e24ca29018.zip
small corrections in error messages
-rw-r--r--strlib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/strlib.c b/strlib.c
index 7000bdc2..1277bb12 100644
--- a/strlib.c
+++ b/strlib.c
@@ -3,7 +3,7 @@
3** String library to LUA 3** String library to LUA
4*/ 4*/
5 5
6char *rcs_strlib="$Id: strlib.c,v 1.29 1996/09/20 18:20:44 roberto Exp roberto $"; 6char *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
360static void str_find (void) 360static 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
421static void str_gsub (void) 421static void str_gsub (void)