Fix read all at EOF.

This commit is contained in:
Enyby
2019-10-07 00:23:34 +03:00
parent 934a8fc57b
commit 65beda4c2b

View File

@@ -618,7 +618,7 @@ public class IoLib extends TwoArgFunction {
public static LuaValue freadall(File f) throws IOException {
int n = f.remaining();
if ( n >= 0 ) {
return freadbytes(f, n);
return n == 0 ? EMPTYSTRING : freadbytes(f, n);
} else {
return freaduntil(f,false,false);
}