aboutsummaryrefslogtreecommitdiff
path: root/src/lib_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib_io.c')
-rw-r--r--src/lib_io.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib_io.c b/src/lib_io.c
index 31f0ea97..53c17d92 100644
--- a/src/lib_io.c
+++ b/src/lib_io.c
@@ -203,13 +203,12 @@ static int io_file_read(lua_State *L, FILE *fp, int start)
203 for (n = start; nargs-- && ok; n++) { 203 for (n = start; nargs-- && ok; n++) {
204 if (tvisstr(L->base+n)) { 204 if (tvisstr(L->base+n)) {
205 const char *p = strVdata(L->base+n); 205 const char *p = strVdata(L->base+n);
206 if (p[0] != '*') 206 if (p[0] == '*') p++;
207 lj_err_arg(L, n+1, LJ_ERR_INVOPT); 207 if (p[0] == 'n')
208 if (p[1] == 'n')
209 ok = io_file_readnum(L, fp); 208 ok = io_file_readnum(L, fp);
210 else if ((p[1] & ~0x20) == 'L') 209 else if ((p[0] & ~0x20) == 'L')
211 ok = io_file_readline(L, fp, (p[1] == 'l')); 210 ok = io_file_readline(L, fp, (p[0] == 'l'));
212 else if (p[1] == 'a') 211 else if (p[0] == 'a')
213 io_file_readall(L, fp); 212 io_file_readall(L, fp);
214 else 213 else
215 lj_err_arg(L, n+1, LJ_ERR_INVFMT); 214 lj_err_arg(L, n+1, LJ_ERR_INVFMT);