aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-09 11:50:08 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-09 11:50:08 -0200
commit80b3d28f4a9e518bf40b35f786199919180bfcd4 (patch)
treee25a410ba61883244207e25b16a853991b417ebb /lstrlib.c
parent69d97712ecfcd06aa4edb7374b262131210d0bbc (diff)
downloadlua-80b3d28f4a9e518bf40b35f786199919180bfcd4.tar.gz
lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.tar.bz2
lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.zip
details (mainly error messages)
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lstrlib.c b/lstrlib.c
index cdd2ffe5..e5b87598 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.2 1997/11/26 18:53:45 roberto Exp roberto $
3** Standard library for strings and pattern-matching 3** Standard library for strings and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -283,7 +283,7 @@ static char *matchitem (char *s, char *p, int level, char **ep)
283 else if (*p == 'b') { /* balanced string */ 283 else if (*p == 'b') { /* balanced string */
284 p++; 284 p++;
285 if (*p == 0 || *(p+1) == 0) 285 if (*p == 0 || *(p+1) == 0)
286 lua_error("bad balanced pattern specification"); 286 lua_error("unbalanced pattern");
287 *ep = p+2; 287 *ep = p+2;
288 return matchbalance(s, *p, *(p+1)); 288 return matchbalance(s, *p, *(p+1));
289 } 289 }
@@ -484,7 +484,7 @@ static void str_format (void)
484 arg++; 484 arg++;
485 strncpy(form+1, initf, strfrmt-initf+1); /* +1 to include convertion */ 485 strncpy(form+1, initf, strfrmt-initf+1); /* +1 to include convertion */
486 form[strfrmt-initf+2] = 0; 486 form[strfrmt-initf+2] = 0;
487 buff = openspace(1000); /* to store the formated value */ 487 buff = openspace(1000); /* to store the formatted value */
488 switch (*strfrmt++) { 488 switch (*strfrmt++) {
489 case 'q': 489 case 'q':
490 luaI_addquoted(luaL_check_string(arg)); 490 luaI_addquoted(luaL_check_string(arg));
@@ -503,7 +503,7 @@ static void str_format (void)
503 sprintf(buff, form, luaL_check_number(arg)); 503 sprintf(buff, form, luaL_check_number(arg));
504 break; 504 break;
505 default: /* also treat cases 'pnLlh' */ 505 default: /* also treat cases 'pnLlh' */
506 lua_error("invalid format option in function `format'"); 506 lua_error("invalid option in `format'");
507 } 507 }
508 lbuffer.size += strlen(buff); 508 lbuffer.size += strlen(buff);
509 } 509 }