diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 13:46:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 13:46:45 -0300 |
commit | 2f02d264e987c74c1619a1d9f70efc87b2369886 (patch) | |
tree | 72e07357b5efc792cdfeb1f23a5afb7e4dffc251 /liolib.c | |
parent | 037a70dfea9de66e8d27c8d3ce2ed9f159a1b094 (diff) | |
download | lua-2f02d264e987c74c1619a1d9f70efc87b2369886.tar.gz lua-2f02d264e987c74c1619a1d9f70efc87b2369886.tar.bz2 lua-2f02d264e987c74c1619a1d9f70efc87b2369886.zip |
initial '*' in 'io.read' formats is deprecated
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.119 2014/03/13 20:07:18 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.120 2014/03/19 18:57:42 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 | */ |
@@ -455,9 +455,9 @@ static int g_read (lua_State *L, FILE *f, int first) { | |||
455 | success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); | 455 | success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); |
456 | } | 456 | } |
457 | else { | 457 | else { |
458 | const char *p = lua_tostring(L, n); | 458 | const char *p = luaL_checkstring(L, n); |
459 | luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); | 459 | if (*p == '*') p++; /* skip optional '*' (for compatibility) */ |
460 | switch (p[1]) { | 460 | switch (*p) { |
461 | case 'i': /* integer */ | 461 | case 'i': /* integer */ |
462 | success = read_integer(L, f); | 462 | success = read_integer(L, f); |
463 | break; | 463 | break; |