Reply to message «[PATCH] readfile() could not read a file if the file contains only one line without an NL at the end», sent 10:48:53 26 March 2011, Saturday by H Xu:
> To reproduce:
> :!echo -n 'Hello' >temp.txt
> :echo readfile('temp.txt')
>
> Then an empty list is displayed rather than the content of this file.
Workaround: use "b" as a second argument to `readfile()': I never needed
readfile() to do some processing of the text and with 'b' you can create a copy
of a file by using `writefile(readfile(file, "b"), file2, "b")' that is not
possible without "b".
Original message:
> Hello,
>
> To reproduce:
> :!echo -n 'Hello' >temp.txt
> :echo readfile('temp.txt')
>
> Then an empty list is displayed rather than the content of this file.
>
> The attached patch fixes this problem.
>
> Regards,
> Hong Xu
> 2011/3/26
signature.asc
Description: This is a digitally signed message part.
