diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-02 14:12:27 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-02 14:12:27 -0300 |
| commit | 85dcb411a8454de0bc1c2c60a24af1588e436c23 (patch) | |
| tree | 169fc4cefe7ba02a46944a172660aff208b3e42e /liolib.c | |
| parent | 3c6a383d6239629fd8858e0d59bcdab25138bcc1 (diff) | |
| download | lua-85dcb411a8454de0bc1c2c60a24af1588e436c23.tar.gz lua-85dcb411a8454de0bc1c2c60a24af1588e436c23.tar.bz2 lua-85dcb411a8454de0bc1c2c60a24af1588e436c23.zip | |
all textual errors go through `luaL_verror'
Diffstat (limited to 'liolib.c')
| -rw-r--r-- | liolib.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 2.2 2002/04/05 18:54:31 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.3 2002/04/12 19:56:25 roberto Exp roberto $ |
| 3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -118,7 +118,7 @@ static int io_open (lua_State *L) { | |||
| 118 | 118 | ||
| 119 | static int io_popen (lua_State *L) { | 119 | static int io_popen (lua_State *L) { |
| 120 | #ifndef POPEN | 120 | #ifndef POPEN |
| 121 | lua_error(L, "`popen' not supported"); | 121 | luaL_verror(L, "`popen' not supported"); |
| 122 | return 0; | 122 | return 0; |
| 123 | #else | 123 | #else |
| 124 | FILE *f = popen(luaL_check_string(L, 1), luaL_opt_string(L, 2, "r")); | 124 | FILE *f = popen(luaL_check_string(L, 1), luaL_opt_string(L, 2, "r")); |
| @@ -257,7 +257,7 @@ static int g_read (lua_State *L, FILE *f, int first) { | |||
| 257 | else { | 257 | else { |
| 258 | const char *p = lua_tostring(L, n); | 258 | const char *p = lua_tostring(L, n); |
| 259 | if (!p || p[0] != '*') | 259 | if (!p || p[0] != '*') |
| 260 | lua_error(L, "invalid `read' option"); | 260 | luaL_verror(L, "invalid `read' option"); |
| 261 | switch (p[1]) { | 261 | switch (p[1]) { |
| 262 | case 'n': /* number */ | 262 | case 'n': /* number */ |
| 263 | success = read_number(L, f); | 263 | success = read_number(L, f); |
| @@ -270,7 +270,7 @@ static int g_read (lua_State *L, FILE *f, int first) { | |||
| 270 | success = 1; /* always success */ | 270 | success = 1; /* always success */ |
| 271 | break; | 271 | break; |
| 272 | case 'w': /* word */ | 272 | case 'w': /* word */ |
| 273 | lua_error(L, "obsolete option `*w'"); | 273 | luaL_verror(L, "obsolete option `*w'"); |
| 274 | break; | 274 | break; |
| 275 | default: | 275 | default: |
| 276 | luaL_argerror(L, n, "invalid format"); | 276 | luaL_argerror(L, n, "invalid format"); |
| @@ -430,7 +430,7 @@ static int io_rename (lua_State *L) { | |||
| 430 | static int io_tmpname (lua_State *L) { | 430 | static int io_tmpname (lua_State *L) { |
| 431 | char buff[L_tmpnam]; | 431 | char buff[L_tmpnam]; |
| 432 | if (tmpnam(buff) != buff) | 432 | if (tmpnam(buff) != buff) |
| 433 | lua_error(L, "unable to generate a unique filename"); | 433 | luaL_verror(L, "unable to generate a unique filename"); |
| 434 | lua_pushstring(L, buff); | 434 | lua_pushstring(L, buff); |
| 435 | return 1; | 435 | return 1; |
| 436 | } | 436 | } |
| @@ -510,7 +510,7 @@ static int io_date (lua_State *L) { | |||
| 510 | if (strftime(b, sizeof(b), s, stm)) | 510 | if (strftime(b, sizeof(b), s, stm)) |
| 511 | lua_pushstring(L, b); | 511 | lua_pushstring(L, b); |
| 512 | else | 512 | else |
| 513 | lua_error(L, "invalid `date' format"); | 513 | luaL_verror(L, "invalid `date' format"); |
| 514 | } | 514 | } |
| 515 | return 1; | 515 | return 1; |
| 516 | } | 516 | } |
