diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -386,8 +386,10 @@ static int io_lines (lua_State *L) { | |||
386 | } | 386 | } |
387 | aux_lines(L, toclose); /* push iteration function */ | 387 | aux_lines(L, toclose); /* push iteration function */ |
388 | if (toclose) { | 388 | if (toclose) { |
389 | lua_pushvalue(L, 1); /* file will be second result */ | 389 | lua_pushnil(L); /* state */ |
390 | return 2; | 390 | lua_pushnil(L); /* control */ |
391 | lua_pushvalue(L, 1); /* file is the to-be-closed variable (4th result) */ | ||
392 | return 4; | ||
391 | } | 393 | } |
392 | else | 394 | else |
393 | return 1; | 395 | return 1; |