From 5b2a3d77d320d76f12b1666938a9d58c2a848205 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 21 Oct 2022 11:25:30 +0100 Subject: 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. --- runtime/doc/builtin.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 5b383fdfc..5cb0bd950 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -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()|. -- cgit v1.2.1