diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-09 11:50:08 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-09 11:50:08 -0200 |
| commit | 80b3d28f4a9e518bf40b35f786199919180bfcd4 (patch) | |
| tree | e25a410ba61883244207e25b16a853991b417ebb /lstrlib.c | |
| parent | 69d97712ecfcd06aa4edb7374b262131210d0bbc (diff) | |
| download | lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.tar.gz lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.tar.bz2 lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.zip | |
details (mainly error messages)
Diffstat (limited to 'lstrlib.c')
| -rw-r--r-- | lstrlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -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 | } |
