Fix read all at EOF.
This commit is contained in:
@@ -618,7 +618,7 @@ public class IoLib extends TwoArgFunction {
|
|||||||
public static LuaValue freadall(File f) throws IOException {
|
public static LuaValue freadall(File f) throws IOException {
|
||||||
int n = f.remaining();
|
int n = f.remaining();
|
||||||
if ( n >= 0 ) {
|
if ( n >= 0 ) {
|
||||||
return freadbytes(f, n);
|
return n == 0 ? EMPTYSTRING : freadbytes(f, n);
|
||||||
} else {
|
} else {
|
||||||
return freaduntil(f,false,false);
|
return freaduntil(f,false,false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user