check correct index on file handle

always worked before because all callers were checking 0 anyways

closes #2442
This commit is contained in:
payonel 2017-10-16 18:04:31 -07:00
parent 4075d6f16b
commit 5288efaa6a

View File

@ -245,7 +245,7 @@ class FileSystem(val fileSystem: IFileSystem, var label: Label, val host: Option
def checkHandle(args: Arguments, index: Int) = {
if (args.isInteger(index)) {
args.checkInteger(index)
} else args.checkAny(0) match {
} else args.checkAny(index) match {
case handle: HandleValue => handle.handle
case _ => throw new IOException("bad file descriptor")
}