patch 9.0.0810: readblob() returns empty when trying to read too much

Problem:    readblob() returns empty when trying to read too much.
Solution:   Return what is available.
This commit is contained in:
Bram Moolenaar
2022-10-21 11:25:30 +01:00
parent 63c84731c1
commit 5b2a3d77d3
4 changed files with 32 additions and 13 deletions

View File

@ -6866,8 +6866,10 @@ readblob({fname} [, {offset} [, {size}]]) *readblob()*
readblob('/dev/ttyS0', 0, 10)
< When the file can't be opened an error message is given and
the result is an empty |Blob|.
When trying to read bytes beyond the end of the file the
result is an empty blob.
When the offset is beyond the end of the file the result is an
empty blob.
When trying to read more bytes than are available the result
is truncated.
Also see |readfile()| and |writefile()|.