gofrontend: correct file reading logic in Stream_from_file

The implementation of Stream_from_file mishandled several cases:

  * It reversed the check for whether bytes were already available in
    the peek buffer.

  * It considered positive return values from lseek to be an error, when
    only a -1 return value indicates an error.

Change-Id: Ic699d3ff7fe589f5ca2362b3db2971a6b9dc9022
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/259437
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
1 file changed