fix vfsRead reader handling

The current code assumes a well-behavior io.Reader, which works until it doesn't.

Add protection: convert f.Read(b) to io.ReadFull(f, b). While we're here, use the new clear built-in.

Add test coverage, including tests that would have caught the initial bugs and tests ensuring tail clearing.

Merge request reports

Loading